You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[FEATURE]: add model identity info to system prompt #9065
I have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement you want to request
Problem
LLMs running in OpenCode have no awareness of which model they are, which provider is serving them, or which version of OpenCode is running. This causes models to misidentify themselves when asked - for example, in #3063 Claude Sonnet 4.5 incorrectly reported itself as "Claude 3.7 Sonnet".
Issue #3063 was closed without a fix, but this feature request proposes a solution.
Proposed Solution
Add model identity information to the beginning of the system prompt:
You are Claude Sonnet 4 (Anthropic: claude-sonnet-4-20250514) running in OpenCode v1.2.3, the best coding agent on the planet.
This informs the model of:
Its display name and model ID
The provider serving it
The current OpenCode version
The overhead is minimal (a few tokens) while significantly improving the model's ability to accurately identify itself.
Thats because all claude models share the same system prompt (See: /packages/opencode/src/session/system.ts ).
I would rather like to have a variant, where we can name a system prompt for each defined model in opencode.json, but to make a simple step forward, I asked (and made a pull request) to allow custom prompts on the global configuration scope as well as in the project scope, which would help in your case as well (See #7101 )
Reviving this lineage in #51909 (issue) and #51911 (draft PR): the model part landed via 88bcd04 as a prose line in the main system prompt, but the version never did, and neither reaches the structured <env> block — which subagents / custom agents may miss entirely. #51909 is the re-open that the stale-bot's closing message invited.
Activity
github-actions commentedon Jan 17, 2026
This issue might be a duplicate of existing issues. Please check:
Feel free to ignore if none of these address your specific case.
dan-and commentedon Jan 17, 2026
Thats because all claude models share the same system prompt (See: /packages/opencode/src/session/system.ts ).
I would rather like to have a variant, where we can name a system prompt for each defined model in opencode.json, but to make a simple step forward, I asked (and made a pull request) to allow custom prompts on the global configuration scope as well as in the project scope, which would help in your case as well (See #7101 )
bdwelle commentedon Jan 24, 2026
I just submitted PR 10451 - create and expose model-id environment variables for bash from CLI that would provide a solution for this feature request.
vikanezrimaya commentedon Feb 11, 2026
Seems to be implemented with 88bcd04?
tredondo commentedon Feb 20, 2026
@dan-and Don't models also have their own system prompt as well? See https://github.com/anomalyco/opencode/tree/dev/packages/opencode/src/session/prompt
github-actions commentedon Apr 22, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.
PascalBourdier commentedon Sep 28, 2026
Reviving this lineage in #51909 (issue) and #51911 (draft PR): the model part landed via 88bcd04 as a prose line in the main system prompt, but the version never did, and neither reaches the structured
<env>block — which subagents / custom agents may miss entirely. #51909 is the re-open that the stale-bot's closing message invited.