Skip to content

Conversation

spoons-and-mirrors
Copy link
Contributor

@spoons-and-mirrors spoons-and-mirrors commented Aug 14, 2025

Summary

Introduce a new optional config parameter to agents: promptMode

The promptMode param has 2 possible values: append and replace

  • append: Appends the agent's system prompt to opencode's default prompt (example: keep beastmode prompt for gpt 4.1 while adding something to the system prompt of your custom agent)
  • replace: Using replace or not specifying promptMode is the same thing - it will replace opencode's default system prompt with yours

Maybe this should a boolean instead?

…t's prompt to opencode's default system prompt
@spoons-and-mirrors spoons-and-mirrors marked this pull request as ready for review August 14, 2025 21:05
@spoons-and-mirrors spoons-and-mirrors changed the title feat(prompt): add promptMode to the config to append/replace the agen… feat(prompt): add promptMode to the config to append/replace agent's system prompt Aug 14, 2025
@thdxr
Copy link
Contributor

thdxr commented Aug 15, 2025

i've been thinking about the right way to allow configuring this. i think maybe saying extend: true can make sense?

@spoons-and-mirrors
Copy link
Contributor Author

Yes! much better. god naming things is hard :D

the PR is updated to use extend

@spoons-and-mirrors spoons-and-mirrors changed the title feat(prompt): add promptMode to the config to append/replace agent's system prompt feat(prompt): add extend: true to the config to append/replace agent's system prompt Aug 15, 2025
@svkozak
Copy link
Contributor

svkozak commented Aug 15, 2025

Love this! What about extendPrompt: z.boolean().optional() to make it even more clear?

@spoons-and-mirrors
Copy link
Contributor Author

idk, we're already within an agent config, there's not much you can extend other than the default system prompt, is there?

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.

3 participants