Incorrect model selection on startup when there are custom models based on selected one #2070

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

Originally created by @geril07 on GitHub (Oct 13, 2025).

Originally assigned to: @rekram1-node on GitHub.

I defined custom OpenRouter OpenAI models with different reasoning effort levels.
However, when I select the default one and then reopen OpenCode, the selected model is usually one of the custom ones instead of the one I originally chose.

Example

"provider/openrouter/models": {
  ...
  "openai/gpt-5-mini-high": {
    "id": "openai/gpt-5-mini",
    "name": "GPT-5 Mini (High)"
  },
  "openai/gpt-5-mini-low": {
    "id": "openai/gpt-5-mini"
  }
  ...
}

model is not specified in the config.

Steps to Reproduce

  1. Define models based on an existing model (id).
  2. Open OpenCode and select the base model.
  3. Reopen OpenCode — I suppose the selected model will be one of the custom ones instead of the previously selected one.

https://github.com/user-attachments/assets/37a2e4e7-93d1-4f46-bafc-a3bf42014cb9

I haven't checked if it's only TUI bug or not though

UPD: the same with agents switching from #3015. Maybe it's actually a duplicate, but i feel like they are a little different

Originally created by @geril07 on GitHub (Oct 13, 2025). Originally assigned to: @rekram1-node on GitHub. I defined custom **OpenRouter OpenAI** models with different reasoning effort levels. However, when I select the default one and then reopen **OpenCode**, the selected model is usually one of the custom ones instead of the one I originally chose. Example ```json "provider/openrouter/models": { ... "openai/gpt-5-mini-high": { "id": "openai/gpt-5-mini", "name": "GPT-5 Mini (High)" }, "openai/gpt-5-mini-low": { "id": "openai/gpt-5-mini" } ... } ``` `model` is not specified in the config. Steps to Reproduce 1. Define models based on an existing model (`id`). 2. Open OpenCode and select the base model. 3. Reopen OpenCode — I suppose the selected model will be one of the custom ones instead of the previously selected one. https://github.com/user-attachments/assets/37a2e4e7-93d1-4f46-bafc-a3bf42014cb9 I haven't checked if it's only TUI bug or not though UPD: the same with agents switching from #3015. Maybe it's actually a duplicate, but i feel like they are a little different
yindo closed this issue 2026-02-16 17:34:01 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Oct 13, 2025):

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

  • #3015: agents switch does not respect the custom model with id - This is very similar as it involves custom models with 'id' fields not being selected correctly when switching contexts
  • #1243: Opencode calls 'Claude 3.5 Haiku' on session start, despite selecting a custom model - This describes the exact same behavior where a custom model is selected but a different model is used on startup
  • #2877: Models search does not show custom models unless explicit difference is specified - This is from the same author and involves custom models with 'id' fields having selection issues

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Oct 13, 2025): This issue might be a duplicate of existing issues. Please check: - #3015: agents switch does not respect the custom model with id - This is very similar as it involves custom models with 'id' fields not being selected correctly when switching contexts - #1243: Opencode calls 'Claude 3.5 Haiku' on session start, despite selecting a custom model - This describes the exact same behavior where a custom model is selected but a different model is used on startup - #2877: Models search does not show custom models unless explicit difference is specified - This is from the same author and involves custom models with 'id' fields having selection issues Feel free to ignore if none of these address your specific case.
Author
Owner

@rekram1-node commented on GitHub (Oct 13, 2025):

yeah there is a fix that needs to be done for #3015 that will resolve this too

@rekram1-node commented on GitHub (Oct 13, 2025): yeah there is a fix that needs to be done for #3015 that will resolve this too
Author
Owner

@rekram1-node commented on GitHub (Oct 13, 2025):

I think ill close this as a duplicate since it has the same underlying issue

@rekram1-node commented on GitHub (Oct 13, 2025): I think ill close this as a duplicate since it has the same underlying issue
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#2070