Skip to content

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

@ferdinandyb

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

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