Skip to content

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

Closed

Description

@ferdinandyb

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

Activity

  1. added
    discussionUsed for feature requests, proposals, ideas, etc. Open discussion
    on Jan 17, 2026
  2. github-actions commented on Jan 17, 2026

    @github-actions
    Contributor

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

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

  3. dan-and commented on Jan 17, 2026

    @dan-and

    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 )

  4. bdwelle commented on Jan 24, 2026

    @bdwelle
    Contributor

    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.

  5. vikanezrimaya commented on Feb 11, 2026

    @vikanezrimaya

    Seems to be implemented with 88bcd04?

  6. tredondo commented on Feb 20, 2026

    @tredondo

    Thats because all claude models share the same system prompt (See: /packages/opencode/src/session/system.ts ).

    @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

  7. github-actions commented on Apr 22, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

  8. PascalBourdier commented on Sep 28, 2026

    @PascalBourdier

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

discussionUsed for feature requests, proposals, ideas, etc. Open discussion

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions