feat(prompt): add `extend: true` to the config to append/replace agent's system prompt
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: Usingreplaceor not specifying promptMode is the same thing - it will replace opencode's default system prompt with yours
Maybe this should a boolean instead?
i've been thinking about the right way to allow configuring this. i think maybe saying extend: true can make sense?
Yes! much better. god naming things is hard :D
the PR is updated to use extend
Love this! What about extendPrompt: z.boolean().optional() to make it even more clear?
idk, we're already within an agent config, there's not much you can extend other than the default system prompt, is there?