opencode
opencode copied to clipboard
[FEATURE]: add model identity info to system prompt
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)