Skip to content

v2: no credential path for custom provider IDs breaks adding custom providers from GUI clients #51527

Open

Description

@chenyuhao0628

Description

Custom providers seem to have no working credential path on the v2 integration API, which breaks adding them from GUI clients:

  • Integration.connection.key (packages/core/src/integration.ts) dies with Key method not found: <id> unless an integration with that exact ID is registered.
  • Key methods are only registered for providers present in the models.dev catalog (packages/core/src/plugin/models-dev.ts) plus plugin-defined ones — so a custom provider ID can never get a key through integration.connect.key.

Concretely: OpenChamber's custom-provider form routes the API key through this endpoint and always fails with "Integration not found: " for any custom ID (filed as openchamber/openchamber#4038). The official desktop dialog works around this by using the legacy auth.set (packages/opencode/src/server/routes/instance/httpapi/groups/control.ts) + config write instead.

Separately: a user on the stable OpenCode Desktop reports being unable to add custom providers/models from the UI — can you confirm which desktop release ships the custom-provider dialog (packages/app/src/components/dialog-custom-provider.tsx), and whether it is expected to work against the bundled server?

Question: is auth.set the intended long-term path for custom-provider credentials, or should integration.connect.key also accept arbitrary provider IDs? Right now any third-party GUI following the integration API cannot add custom providers.

OpenCode version

Source analysis of dev branch (2026-09-27); stable desktop 1.2.x

Activity

  1. github-actions commented on Sep 26, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

  2. keponk commented on Oct 21, 2026

    @keponk

    @chenyuhao0628 did you find a workaround? my custom provider works great on cli, but there's no way to access it via desktop. I keep getting:

    "error": {
        "type": "provider.error",
        "message": "Unauthorized: Unauthorized"
      }
    
  3. chenyuhao0628 commented on Oct 21, 2026

    @chenyuhao0628
    Author

    @chenyuhao0628 did you find a workaround? my custom provider works great on cli, but there's no way to access it via desktop. I keep getting:

    "error": {
        "type": "provider.error",
        "message": "Unauthorized: Unauthorized"
      }
    

    You could try having the AI directly help you modify the configuration sheet and just use another AI to do the configuration - that's one way

  4. opencodejr commented on Oct 28, 2026

    @opencodejr

    Thanks for the detailed write-up, @chenyuhao0628.

    On v2 (dev), custom providers can already get credentials through the integration API, but only after the provider is in config:

    • packages/core/src/config/plugin/provider.ts registers a key method ("Manually enter API Key") for every provider under providers.<id>. It also adds an env method when env is set.
    • So the working order is: write the provider to config first, then, once the config has reloaded, call integration.connect.key with that ID.
    • Integration not found: <id> is what the server returns for an ID that isn't registered yet. That fits a client sending the key before the provider exists in config.

    Your actual request is something different: let integration.connect.key accept any provider ID and store a credential before any config exists, or at least document the config-then-key order for third-party clients. I've recorded this as a feature request for maintainers to consider.

    About the desktop part: the files you mention (packages/opencode/src/.../control.ts with auth.set, and packages/app/src/components/dialog-custom-provider.tsx) are v1 code, and stable desktop 1.2.x is v1. v1 only gets critical fixes. If adding custom providers fails on v2 even with the provider already in config, please reply with the version and the steps, and we'll look at it as a bug.

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions