Skip to content

Conversation

@luochen1990
Copy link
Contributor

Summary

This PR adds support for appending to the default agent prompt via the configuration file using a new prompt_append field. This allows users to extend the behavior of existing agents (like explore or build) without completely replacing the default prompt, which is useful for adding project-specific instructions while keeping the core agent logic intact.

Changes

  • Modified Agent schema in config.ts to include prompt_append.
  • Updated agent.ts to handle appending logic: if prompt_append is present, it is appended to the existing prompt (default or overridden) with a double newline separator.
  • Added tests in packages/opencode/test/agent/agent.test.ts to verify the behavior.

Usage

In opencode.json:

{
  "agent": {
    "explore": {
      "prompt_append": "Please prioritize finding files in src/legacy/."
    }
  }
}

@github-actions
Copy link
Contributor

github-actions bot commented Jan 8, 2026

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

No duplicate PRs found

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.

1 participant