Skip to content

Saving an API key from Settings fails: secret grant denied without a WebChat origin #8596

Description

@senamakel

In a product build, saving an API key from Settings fails with Failed to encrypt api_key, and the user is never asked to approve it.

To reproduce, run openhuman-core serve with the file keyring and call config_update_model_settings with an api_key, without the test keyring responder. The call fails in about a second. The gate logs forced approval denied: no routable WebChat origin on this task tool=native_secret_grant origin=Unknown.

Why it fails:

  • Sealing a secret needs a one-time native_secret_grant (modules/security/secret_cipher.rs).
  • ApprovalGate::intercept_forced denies any forced approval that isn't from a WebChat turn with a thread and client id. A Settings RPC has neither.
  • The grant never parks, so nothing reaches the UI. The RPC returns only the outer error context.

The unit and integration tests miss this because they run a test responder that answers the approval.

Activity

  1. added
    priority: p1
    on Nov 7, 2026
  2. tinysweeper commented on Nov 7, 2026

    @tinysweeper

    Saving an API key from Settings fails with Failed to encrypt api_key because ApprovalGate::intercept_forced denies the one-time native_secret_grant when the request has no routable WebChat origin. A Settings RPC never has a WebChat thread/client id, so the grant never parks, nothing reaches the UI for approval, and the RPC returns only the outer error — tests miss it due to a test responder that auto-approves.

    Labelled priority: p1.

  3. added theissue type on Nov 7, 2026
  4. M3gA-Mind commented on Nov 9, 2026

    @M3gA-Mind
    Collaborator

    Reopening: this was closed automatically when #8607 merged, because #8607's checklist line said "This doesn't fix #8596" and GitHub reads "fix #8596" as a closing keyword even after "doesn't". #8607 only made the skipped browser test cite this issue. The bug is still open; #8597 is the fix in review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

priority: p1

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions