Skip to content

Per-Model Instructions #1891

Closed
Closed

Description

@giddie

I've been trying out GPT-5, and it needs very different behavioural instructions compared to the Anthropic models. It would be really nice if the "instructions" files defined in the config could be defined per provider/model, so that we can switch between models and they'll pick up the relevant instructions without having to edit the config file.

Activity

  1. nefthy commented on Aug 13, 2025

    @nefthy

    There actually are different system prompts for some models. GPT-5 uses the packages/opencode/src/session/prompt/codex.txt

  2. florath commented on Aug 14, 2025

    @florath

    I completely support this feature request!
    There should be the possibility to use custom prompts, maybe on an agent level?

    Currently there is a differentiation based on the model name:

    https://github.com/sst/opencode/blob/dev/packages/opencode/src/session/system.ts#L24
    
    import PROMPT_COPILOT_GPT_5 from "./prompt/copilot-gpt-5.txt"
    [...]
    
      export function provider(modelID: string) {
        if (modelID.includes("gpt-5")) return [PROMPT_COPILOT_GPT_5]
        if (modelID.includes("gpt-") || modelID.includes("o1") || modelID.includes("o3")) return [PROMPT_BEAST]
        if (modelID.includes("gemini-")) return [PROMPT_GEMINI]
        if (modelID.includes("claude")) return [PROMPT_ANTHROPIC]
        return [PROMPT_ANTHROPIC_WITHOUT_TODO]
      }
    

    So IMHO for GPT-5 copilot-gpt-5.txt is used and not codex.txt (which is in my opinion not used at all at the moment).
    @nefthy: can you please check?

  3. rekram1-node commented on Aug 14, 2025

    @rekram1-node
    Collaborator

    I think what @giddie is getting at is that instructions: in your config should allow you to specify which models you want to load the instruction for.

    makes sense, some models behave differently than others

  4. self-assigned this
    on Aug 14, 2025
  5. nefthy commented on Aug 14, 2025

    @nefthy

    @florath yes you are right. It has changed since I last checked it :)

  6. rekram1-node commented on Dec 28, 2025

    @rekram1-node
    Collaborator

    [automated] Closing due to 90+ days of inactivity. Feel free to reopen if you still need this!

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions