Skip to content

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

Closed
luochen1990 wants to merge 1 commit into
anomalyco:devfrom
luochen1990:feature/agent-prompt-append
Closed

luochen1990 wants to merge 1 commit into
anomalyco:devfrom
luochen1990:feature/agent-prompt-append

Conversation

@luochen1990

Copy link
Copy Markdown
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

github-actions Bot commented Jan 8, 2026

Copy link
Copy Markdown
Contributor

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

No duplicate PRs found

@BGuimberteau

Copy link
Copy Markdown

Hello, very useful PR, it's possible to merge?

@github-actions

Copy link
Copy Markdown
Contributor

Closing this pull request because it has had no updates for more than 60 days. If you plan to continue working on it, feel free to reopen or open a new PR.

@github-actions github-actions Bot closed this Mar 31, 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.

2 participants