Skip to content

Built-in MiniMax providers (minimax.io / minimaxi.com) persist after opencode auth logout and cannot be removed #31832

Closed

Description

@sharyuke

Description

After running opencode auth logout minimax, the built-in MiniMax provider entries (both minimax.io and minimaxi.com) continue to appear in the model selector and the models remain fully usable, even though no authentication credential is stored anywhere on disk.

Only one provider (minimaxi.com) was ever added by the user, but two providers are shown. After auth logout the provider list is not cleared, and re-launching opencode still shows both providers with all their models selectable and working.

This is a privacy/state-correction bug: the user has no way to fully disconnect from a built-in provider via the documented auth logout command.

Steps to reproduce

  1. Start from a clean state — no MiniMax provider configured, no entry in ~/.config/opencode/opencode.json or ~/.local/share/opencode/auth.json.
  2. Run opencode auth login minimax and add a credential for the minimaxi.com endpoint.
  3. Confirm both MiniMax (minimax.io) and MiniMax (minimaxi.com) show up in the model selector with all models (M2, M2.1, M2.5, M2.5-highspeed, M2.7, M2.7-highspeed, M3). (Only the com one was actually added by the user.)
  4. Run opencode auth logout minimax to remove the credential.
  5. Inspect ~/.local/share/opencode/auth.json and ~/.local/share/opencode/account.json — confirm there is no minimax key remaining.
  6. Inspect ~/.config/opencode/opencode.json — confirm there is no minimax entry in provider.
  7. Re-launch opencode and open the model selector.

Expected behavior

After opencode auth logout minimax, the MiniMax provider(s) should no longer appear in the model selector at all (or at minimum the user should be able to fully disconnect/remove them). The configured credential is the only thing that should differ between "connected" and "not connected" — model lists must not be hard-coded into the binary in a way that survives credential removal.

Additionally, only the provider the user actually configured (minimaxi.com) should be listed. The duplicate minimax.io entry should not appear unless the user explicitly added it.

Actual behavior

  • Both MiniMax (minimax.io) and MiniMax (minimaxi.com) are still shown in the model selector.
  • All MiniMax models are still selectable and can be used to send messages successfully.
  • There is no way to remove these entries from the UI.
  • auth logout only deletes the credential, but the provider/model list is still being injected from somewhere (likely a built-in provider catalog baked into the binary or a cache that is not invalidated on logout).

Environment

  • opencode version: 1.17.3
  • OS: Linux (Arch)
  • No plugins
  • Storage backend: local (~/.local/share/opencode/)
  • No MiniMax entry in ~/.config/opencode/opencode.json
  • No MiniMax entry in ~/.local/share/opencode/auth.json after logout
  • No MiniMax entry in ~/.local/share/opencode/account.json after logout

Files inspected (post-logout)

~/.local/share/opencode/auth.json contains only: xiaomi-token-plan-cn, deepseek, kimi-for-coding, xai. No minimax key.

~/.local/share/opencode/account.json contains only: xiaomi-token-plan-cn, deepseek, kimi-for-coding, xai. No minimax key.

~/.config/opencode/opencode.json provider block contains only the user-defined ollama entry. No minimax entry.

Despite all three files being clean, the model selector still shows the MiniMax providers.

Screenshot

Model selector after auth logout minimax — both providers are still listed and the user can select any model:

Image

(Attaching the original screenshot from the report; it shows the Select model dialog with MiniMax (minimax.io) and MiniMax (minimaxi.com) both expanded, with MiniMax-M2 under minimaxi.com highlighted as the current selection.)

Suspected cause

The MiniMax provider model catalog appears to be served from a hard-coded list inside the opencode binary (or a persistent cache that is not cleared on auth logout) rather than being driven solely by the entries in auth.json / account.json / opencode.json. auth logout only removes the credential, leaving the model list behind, so the provider appears "still connected" even when it is not.

Related

Activity

  1. github-actions commented on Jun 11, 2026

    @github-actions
    Contributor

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

    If your issue is distinct from these, please clarify what differentiates it.

  2. sharyuke commented on Jun 11, 2026

    @sharyuke
    Author

    Root cause found — closing as not-a-bug, but documenting for future reference

    After further investigation, the real cause of my confusion was an environment variable in my shell, not a config-file issue.

    Two things are at play

    1. MINIMAX_API_KEY was set in my ~/.bashrc (line 192, export MINIMAX_API_KEY=...). opencode sees this env var and auto-enables the four built-in MiniMax providers (minimax, minimax-cn, minimax-cn-coding-plan, minimax-coding-plan) on every startup, regardless of what's in auth.json / opencode.json. auth logout only removes the credential, it does not clear the env var, so the providers get re-enabled on the next launch.

    2. disabled_providers in opencode.json does work for the CLI, but is not honored by the TUI model selector. I verified this against the source:

      • packages/opencode/src/provider/provider.ts:1328,1331-1335,1549-1552 — the runtime provider loader builds disabled = new Set(cfg.disabled_providers ?? []) and removes matching providers.
      • packages/opencode/test/provider/provider.test.ts — there is even a test "disabled_providers excludes provider" confirming this works.
      • However, the TUI calls the server's provider.list endpoint (packages/server/src/handlers/provider.ts), which returns catalog.provider.available() from packages/core/src/catalog.ts:224-229. That method filters by provider.enabled only and does not consult disabled_providers at all. So even with "disabled_providers": ["minimax", "minimax-cn"] correctly loaded in the resolved config (verified with opencode debug config), the model selector still shows them.

      This second point is a real bug — disabled_providers is documented behavior and should be honored end-to-end. It is silently ignored in the TUI.

    Reproduction (local, v1.17.3)

    $ opencode debug v2
    Total providers: 9
      ...
      minimax: MiniMax (minimax.io) enabled={'via': 'env', 'name': 'MINIMAX_API_KEY'}
      minimax-cn: MiniMax (minimaxi.com) enabled={'via': 'env', 'name': 'MINIMAX_API_KEY'}
      minimax-cn-coding-plan: MiniMax Token Plan (minimaxi.com) enabled={'via': 'env', 'name': 'MINIMAX_API_KEY'}
      minimax-coding-plan: MiniMax Token Plan (minimax.io) enabled={'via': 'env', 'name': 'MINIMAX_API_KEY'}
      ...

    opencode config (and opencode debug config) shows "disabled_providers": ["minimax", "minimax-cn"] in the resolved config, yet provider.list still includes the four MiniMax entries.

    Workaround that works for me

    Unset the env var (or remove the export line from ~/.bashrc) and restart opencode. With the env var gone, the providers are no longer auto-enabled, and the model selector stops listing them:

    unset MINIMAX_API_KEY MINIMAX_API_BASE

    Keeping disabled_providers in opencode.json is still a good idea as a belt-and-suspenders measure for when the env var is set.

    Recommendation

    Two follow-ups worth opening as separate issues:

    1. auth logout should not leave providers in a zombie state. When the user explicitly removes a credential, the env-var auto-loading should also be disabled, or at minimum the user should be warned that the provider will be re-enabled on next launch. Currently the only way to be sure a provider is gone is to track down every place the env var is set.
    2. disabled_providers is not honored by the TUI. CatalogV2.provider.available() should apply the same isProviderAllowed check that the runtime loader uses, so user intent expressed in the config file is respected everywhere.

    Closing this as not-a-bug on the original report, but the env-var behavior is surprising enough to deserve a UX improvement. Sorry for the noise.

  3. sharyuke commented on Jun 11, 2026

    @sharyuke
    Author

    Closing as not-a-bug — root cause was a stale env var in (see comment below). does work for the CLI but is not honored by the TUI catalog layer; recommend opening that as a separate 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