Skip to content

fix(app): disconnecting config-sourced providers is a no-op #260

Description

@jeonghun-jj-lee

Problem — Disconnecting a model provider whose credentials come from the user config file (e.g. opencode zen or amazon-bedrock) shows the "disconnected" success toast, but the provider stays in the connected list. The disconnect flow only removes auth-store credentials and disposes instances; config-sourced credentials are re-read on the next provider-state rebuild, so the provider comes straight back as connected. The working disable path (adding the provider to the config's disabled-providers list, which the server honors on rebuild and which already triggers a full provider-list refetch) is currently reserved for custom openai-compatible providers only. A prior fix covered the connect path (auth mutation → dispose → refresh, plus store re-keying); disconnect semantics for config-sourced credentials were never covered. The same latent gap exists upstream — a subset of this fix is upstreamable later.

Acceptance Criteria

  • Disconnecting a config-sourced provider adds it to the disabled-providers list and it leaves the connected list without an app restart
  • The success toast only fires on actual success; on failure the optimistic update rolls back and an error toast shows
  • Connecting a provider that is in the disabled-providers list clears it from that list (re-enable path)
  • The disconnect control is hidden for config-sourced providers on server generations where the disable path does not exist
  • API-key and custom-token disconnect behavior is unchanged
  • Unit tests cover the disconnect decision for every credential-source × server-generation combination

Metadata

Metadata

Assignees

No one assigned

    Labels

    hitlNeeds a human decision/review

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions