--model flag does not switch Anthropic models in opencode run #2915

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

Originally created by @RandaZraik on GitHub (Nov 17, 2025).

Originally assigned to: @rekram1-node on GitHub.

Description

When running opencode run --model anthropic/xxx, the reported model is always defaulted to Claude 3.5 Sonnet.

OpenCode version

1.0.68

Steps to reproduce

  1. Run opencode --version - output is 1.0.68.
  2. Run opencode models. Select a model for next step.
  3. Run opencode run --model anthropic/claude-sonnet-4-5-20250929 "What specific model are you?"
  4. Output is: I am **Claude 3.5 Sonnet** (specifically the version from October 22, 2024).

Not sure if it's not actually switching or it's a bug with the prompt.

Screenshot and/or share link

No response

Operating System

Arch Linux (Omarchy)

Terminal

Alacritty

Originally created by @RandaZraik on GitHub (Nov 17, 2025). Originally assigned to: @rekram1-node on GitHub. ### Description When running `opencode run --model anthropic/xxx`, the reported model is always defaulted to `Claude 3.5 Sonnet`. ### OpenCode version 1.0.68 ### Steps to reproduce 1. Run `opencode --version` - output is `1.0.68`. 2. Run `opencode models`. Select a model for next step. 3. Run `opencode run --model anthropic/claude-sonnet-4-5-20250929 "What specific model are you?"` 4. Output is: `I am **Claude 3.5 Sonnet** (specifically the version from October 22, 2024).` Not sure if it's not actually switching or it's a bug with the prompt. ### Screenshot and/or share link _No response_ ### Operating System Arch Linux (Omarchy) ### Terminal Alacritty
yindo closed this issue 2026-02-16 17:37:46 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Nov 17, 2025):

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

  • #4281: Model switches back to the original selection after prompting - reports model switching issues with Anthropic Claude models where the model reverts back to the default selection
  • #3863: Model incorrectly changes on agent switch using -m, but correctly sticks using config - reports issues specifically with the --model/-m flag not persisting correctly compared to config-based model selection
  • #4243: Cycle through model do not work when a default model is set - reports model switching functionality not working when a default model is configured

Feel free to ignore if none of these address your specific case with opencode run command.

@github-actions[bot] commented on GitHub (Nov 17, 2025): This issue might be a duplicate of existing issues. Please check: - #4281: Model switches back to the original selection after prompting - reports model switching issues with Anthropic Claude models where the model reverts back to the default selection - #3863: Model incorrectly changes on agent switch using -m, but correctly sticks using config - reports issues specifically with the --model/-m flag not persisting correctly compared to config-based model selection - #4243: Cycle through model do not work when a default model is set - reports model switching functionality not working when a default model is configured Feel free to ignore if none of these address your specific case with `opencode run` command.
Author
Owner

@rekram1-node commented on GitHub (Nov 17, 2025):

@RandaZraik the model cannot tell you what it is, you can replicate this with almost any model they all self report as claude 3.5.

Claude Code in their system prompt explicitly tells the model what model it is, we don't do that so it gives you this behavior

@rekram1-node commented on GitHub (Nov 17, 2025): @RandaZraik the model cannot tell you what it is, you can replicate this with almost any model they all self report as claude 3.5. Claude Code in their system prompt explicitly tells the model what model it is, we don't do that so it gives you this behavior
Author
Owner

@RandaZraik commented on GitHub (Nov 17, 2025):

@rekram1-node ahh that’s interesting to know. Thanks for the clarification! Please feel free to close this issue.

@RandaZraik commented on GitHub (Nov 17, 2025): @rekram1-node ahh that’s interesting to know. Thanks for the clarification! Please feel free to close this issue.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#2915