Skip to content

desktop: Providers settings shows "API key" badge for OAuth (account) connections #50176

Closed

Description

@r4ty94dh84-lang

Summary

In OpenCode Desktop's Providers settings, connected providers show a generic "API key" badge even when they were connected via OAuth with an account (e.g. OpenAI). The badge does not reflect the actual credential type stored by the server.

Environment

  • opencode version: Desktop 2.0.11 (bundled CLI v2.0.11)
  • OS: macOS, Darwin 27.0.0, arm64 (Apple Silicon M1)
  • Terminal: N/A (Desktop app)
  • Shell: /bin/bash
  • Install/channel: stable
  • Active plugins: none

Reproduction

  1. Connect the OpenAI provider with an OpenAI account (OAuth flow) in the Desktop app
  2. Open Settings > Providers
  3. The OpenAI entry shows the "API key" badge

Expected Behavior

The badge should reflect the actual connection method, e.g. "Account (OAuth)" for OAuth credentials and "API key" for key-based credentials.

Actual Behavior

The UI shows the "API key" badge for the OAuth-connected OpenAI provider.

Additional Context

Server-side the credential is correctly typed as OAuth:

  • Server log records credential created ... integrationID=openai type=oauth (the same session also shows integrationID=openrouter type=key, whose "API key" badge is correct)
  • The credential store contains an OAuth JSON payload with access token, refresh token and expiry

So the stored data is right and the label is a UI-only issue, consistent with the display problems reported in #41720.

Activity

  1. mxeshell commented on Oct 1, 2026

    @mxeshell

    Confirming this on Desktop 2.0.20, and adding the multi-account case.

    Repro:

    1. Connect xAI with the SuperGrok Subscription OAuth method.
    2. Connect xAI again with Manually enter API Key.
    3. Settings → Providers: the two accounts are listed as xAI and xAI 2.

    Environment: macOS Darwin 27.0.0 arm64, Desktop 2.0.20 (bundled CLI 2.0.20).

    The server data is correct. GET /api/integration for xai returns:

    • methods: Manually enter API Key (type key) and SuperGrok Subscription (type oauth)
    • connections: { "label": "xAI", "method": "oauth" } and { "label": "xAI 2", "method": "key" }

    So beyond the badge being wrong for a single OAuth connection, when a provider has more than one account the settings list gives no method indication at all; the only differentiator is the numeric label suffix (xAI, xAI 2). Surfacing connection.method per account (a badge, or method-derived default labels) would fix both cases. Renaming via PATCH /api/credential/{credentialID} works around it.

  2. opencodejr commented on Oct 28, 2026

    @opencodejr

    Thanks for the detailed report. I could reproduce this on 2.0.11: with an OAuth credential stored for OpenAI and a key credential for OpenRouter, Settings > Providers labelled both as API key. I tested in the web UI, which uses the same settings code as Desktop.

    On the latest dev (fa1260d), the same setup shows OpenAI as Account and OpenRouter as API key. The server now tells the app whether each credential is OAuth or a key, and the badge uses that. By the release tags, the change came with #50267 and first shipped in v2.0.13, so updating Desktop should fix it.

    The bot will close this issue in 1 day unless you reply that it still happens on a newer version.

  3. opencodejr commented on Oct 29, 2026

    @opencodejr

    Closing this as fixed, since there's been no reply in the past day. On 2.0.11, an OAuth-connected OpenAI provider showed the API key badge in Settings > Providers. On the latest dev (fa1260d) it shows Account, and key-based providers like OpenRouter still show API key. The fix came with #50267 and is in the release tags from v2.0.13 onward, so updating Desktop should fix it.

    If you still see the wrong badge on a newer version, please comment here or open a new issue with your version. Thanks for the detailed report!

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions