Allow explicit disabling of providers that may have env variable api key set for other tools #97

Closed
opened 2026-02-16 17:25:11 -05:00 by yindo · 3 comments
Owner

Originally created by @GitMurf on GitHub (Jun 16, 2025).

Originally assigned to: @thdxr on GitHub.

I have my OpenAI api key set as env variable for other tools, but I don't want it to show up in the model chooser for opencode. In previous "go version" of opencode we could explicitly disable providers. Is there a way you could implement that? I only want specific providers to show up when using /model but if OpenAI api key env variable is set, opencode seems to auto "load it".

Originally posted by @GitMurf in https://github.com/sst/opencode/issues/152#issuecomment-2978630789

Originally created by @GitMurf on GitHub (Jun 16, 2025). Originally assigned to: @thdxr on GitHub. I have my OpenAI api key set as env variable for other tools, but I don't want it to show up in the model chooser for opencode. In previous "go version" of opencode we could explicitly disable providers. Is there a way you could implement that? I only want specific providers to show up when using /model but if OpenAI api key env variable is set, opencode seems to auto "load it". _Originally posted by @GitMurf in https://github.com/sst/opencode/issues/152#issuecomment-2978630789_
yindo closed this issue 2026-02-16 17:25:11 -05:00
Author
Owner

@GitMurf commented on GitHub (Jun 18, 2025):

Thanks @thdxr it looks like you implemented here: 674c9a5

And I confirmed if I add to my main opencode config file the following that it indeed disables them!

disabled_providers = ["openai", "anthropic"]

But the problem is that after closing any opencode session, it saves / overwrites your config file removing the disabled_providers key as it must not think it is valid config item or something.

@GitMurf commented on GitHub (Jun 18, 2025): Thanks @thdxr it looks like you implemented here: 674c9a5 And I confirmed if I add to my main opencode `config` file the following that it indeed disables them! ```toml disabled_providers = ["openai", "anthropic"] ``` But the problem is that after closing any opencode session, it saves / overwrites your `config` file removing the `disabled_providers` key as it must not think it is valid config item or something.
Author
Owner

@thdxr commented on GitHub (Jun 18, 2025):

yeah this is a bug in the tui adam is fixing today

@thdxr commented on GitHub (Jun 18, 2025): yeah this is a bug in the tui adam is fixing today
Author
Owner

@rekram1-node commented on GitHub (Sep 25, 2025):

@GitMurf I think this has been fixed now, closing unless this is still an issue for you

@rekram1-node commented on GitHub (Sep 25, 2025): @GitMurf I think this has been fixed now, closing unless this is still an issue for you
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#97