Skip to content

feat(opencode): allow configuring custom agents to the same extent as included agents#14211

Open
nleve wants to merge 2 commits intoanomalyco:devfrom
nleve:native-agent-config-parity
Open

feat(opencode): allow configuring custom agents to the same extent as included agents#14211
nleve wants to merge 2 commits intoanomalyco:devfrom
nleve:native-agent-config-parity

Conversation

@nleve
Copy link

@nleve nleve commented Feb 19, 2026

Issue for this PR

Closes #14210

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

This PR enables configuring model-specific system prompts for agents, as well as configuring reminder and transition prompt additions for agents.

How did you verify your code works?

I set up a custom model-specific prompt for anthropic models for Plan and Build agents in my opencode.json, and verified this applied only when a matching model was selected.

Also set up a custom plan reminder ("write 'PLAN MODE ACTIVE! MOLGAR READY TO PLAN!' at the end of every message") and transition prompt ("write 'MOLGAR SWITCHED TO BUILD MODE! BUILD MODE ACTIVE AND MOLGAR READY TO BUILD!' when switching to build mode"), and validated those were being inserted.

Config example:

{
  "$schema": "https://opencode.ai/config.json",
  "agent": {
    "build": {
      "prompt": {
        "*opus*|*sonnet*|*haiku*": "{file:./prompts/molgar.txt}",
        "*": "{file:./prompts/default.txt}"
      },
      "transition": "{file:./prompts/build-transition.txt}"
    },
    "plan": {
      "prompt": {
        "*opus*|*sonnet*|*haiku*": "{file:./prompts/molgar.txt}",
        "*": "{file:./prompts/default.txt}"
      },
      "reminder": "{file:./prompts/plan-reminder.txt}"
    }
  }
}

NOTE: I didn't bother implementing anything related to the experimental plan mode flag, as last I heard that might not stick around. I haven't been closely involved with this though so might be wrong on that.

Screenshots / recordings

image

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@github-actions
Copy link
Contributor

The following comment was made by an LLM, it may be inaccurate:

I found a couple of related PRs that might be relevant:

Potentially Related:

  1. PR feat(agent): support appending to agent prompts via config #7310 - feat(agent): support appending to agent prompts via config

    • This PR adds support for appending to agent prompts via configuration, which is related to your feature of making prompts configurable. Your PR extends this with model-specific prompts, reminders, and transitions.
  2. PR feat(opencode): agent-specific instructions array #10695 - feat(opencode): agent-specific instructions array

    • This PR adds agent-specific instructions configuration, which is related to your agent configuration feature.

These PRs address related agent configuration functionality but appear to be more limited in scope compared to PR #14211. Your PR expands the configuration system to support model-specific prompts and additional prompt types (reminders, transitions).

@nleve nleve changed the title feat(opencode): make agent prompts, reminders, and transitions config… feat(opencode): allow configuring custom agents to the same extent as included agents Feb 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE]: Configurable model-specific agent prompts, reminders, and transitions

2 participants

Comments