[FEATURE]: add model identity info to system prompt #6587

Open
opened 2026-02-16 18:04:40 -05:00 by yindo · 4 comments
Owner

Originally created by @ferdinandyb on GitHub (Jan 17, 2026).

Originally assigned to: @thdxr on GitHub.

Feature hasn't been suggested before.

  • 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.

Related

  • #3063 - Model identity incorrectly reported (closed without fix, this addresses the root cause)
Originally created by @ferdinandyb on GitHub (Jan 17, 2026). Originally assigned to: @thdxr on GitHub. ### Feature hasn't been suggested before. - [x] 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. ### Related - #3063 - Model identity incorrectly reported (closed without fix, this addresses the root cause)
yindo added the discussion label 2026-02-16 18:04:40 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Jan 17, 2026):

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

  • #3063: Model identity incorrectly reported - Claude/OAuth issue (the original issue this feature request aims to fix)
  • #7351: Add systemPrompt option to SDK like Claude Agent SDK (related system prompt customization)
  • #7101: Allow custom system prompts in global, project or custom directories (related system prompt management)

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

@github-actions[bot] commented on GitHub (Jan 17, 2026): This issue might be a duplicate of existing issues. Please check: - #3063: Model identity incorrectly reported - Claude/OAuth issue (the original issue this feature request aims to fix) - #7351: Add systemPrompt option to SDK like Claude Agent SDK (related system prompt customization) - #7101: Allow custom system prompts in global, project or custom directories (related system prompt management) Feel free to ignore if none of these address your specific case.
Author
Owner

@dan-and commented on GitHub (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 )

@dan-and commented on GitHub (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 )
Author
Owner

@bdwelle commented on GitHub (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.

@bdwelle commented on GitHub (Jan 24, 2026): I just submitted [PR 10451 - create and expose model-id environment variables for bash from CLI](https://github.com/anomalyco/opencode/pull/10451) that would provide a solution for this feature request.
Author
Owner

@vikanezrimaya commented on GitHub (Feb 11, 2026):

Seems to be implemented with 88bcd0465971cbab4f26134db52f2dcd935d5fc9?

@vikanezrimaya commented on GitHub (Feb 11, 2026): Seems to be implemented with 88bcd0465971cbab4f26134db52f2dcd935d5fc9?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#6587