You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am overriding the built-in agents (e.g., using agent/plan.md) which although not documented, it successfully catches my new prompt. However, I want this agent to be able to write markdown files, but even though i am properly setting permissions, agent qoutes:
"CRITICAL: Plan mode ACTIVE - you are in READ-ONLY phase. STRICTLY
FORBIDDEN: ANY file edits, modifications, or system changes...
Expected behavior in my opinion is that if another definition of a plan agent exists, it should bypass the original plan agent entirely.
OpenCode version
0.15.29 (latest)
Steps to reproduce
define plan.md agent
give it write permissions (e.g., to a .md files, example below)
give it a custom prompt
ask it to generate a file and see your prompt is used but permissions are ignored
Ahh this is something I stupidly didn't think about lol
The prompt reminder we give it says it can't edit files, we should probably adjust it to tell the agent it's own permissions and encourage it to obey them.
why not allowing to override built-in agent entirely? Instead of messing with carry-over from built-in spec to a custom agent with the same name, we can just allow a complete override.
So, if the user defines a "plan" agent, the built-in one become obsolete, and the PLAN agent that appears points to the custom agent entirely.
Sounds simpler and more pragmatic
oh interesting. i wonder why these are not implemented simply as permissions (that can be overriden). sounds like a non-trivial decision so I'll just rename my agent to something other than plan for now :)
i wonder why these are not implemented simply as permissions
They are implemented as permissions but there are system reminders too (essentially just hidden user messages), because we don't want the agent to try to abuse the tools it does have to get around the idea of being in "plan" mode
I don't think it is non-trivial to add some way to customize around this, just probably not the highest priority atm
... so I'll just rename my agent to something other than plan for now :)
Exactly what I did, so I now have a plan and a planner agent ;)
It's not the worse thing in the world, but of course simply being able to disable the built in agents would make it cleaner.
Reacted by oribi, Mark Van de Vyver, Pablo Hörtner, CXwudi and OracleToes
the system reminder may need to be thought out a little bit just to see what makes sense but disabled would be fine, maybe add a disabled field to an agent definition similar to how lsp and formatters have it defined
In OpenCode 1.0.61 one can disable an built-in agent (https://opencode.ai/docs/agents/#disable), but it is still not possible to reuse its name or override it with the agent markdown definition.
I have a feeling everything would be simpler if built-in agents would also be defined with the agent markdown definition instead of with code, then overrides could be supported at the file-loading level.
Reacted by Andy Gimblett, Pablo Hörtner, Sergei Korolev, Christian Metts, CXwudi, Eugene Korekin, valentimarco, inwonakng and Roman Novatorov
I ran into some unexpected behavior around this. I added the atlassian mcp server and wanted to use the built in plan agent to plan out some new tickets with some back and forth. But the plan agent just went ahead and made the ticket right away.
Which now that I know more makes sense because nothing in the default perms denys it from using mcp calls.
I think I could fix it by adding something like this but that doesn't help if I can't override permissions easily.
Furthermore when I asked it to update the ticket after some further planning it had an issue with the mcp calls and then just went ahead and made the changes to the codebase while still in the plan agent. Which was unexpected. This was however on v1.0.220 as I didn't realize that homebrew didn't have the latest. I've since updated.
I do wonder if it'd be best to make some jira specific subagents and give them structured perms and prompts.
Yeah it's annoying the solution here is to just disable the built in because a) you can't unreserve it's name and b) it doesn't track with the docs which imply over and over you can override the built in's via json or markdown by naming the agent config the same as the built in.
Activity
rekram1-node commentedon Oct 30, 2025
Ahh this is something I stupidly didn't think about lol
The prompt reminder we give it says it can't edit files, we should probably adjust it to tell the agent it's own permissions and encourage it to obey them.
Then we can use some basic templating to fix this
oribarilan commentedon Oct 30, 2025
why not allowing to override built-in agent entirely? Instead of messing with carry-over from built-in spec to a custom agent with the same name, we can just allow a complete override.
So, if the user defines a "plan" agent, the built-in one become obsolete, and the PLAN agent that appears points to the custom agent entirely.
Sounds simpler and more pragmatic
rekram1-node commentedon Oct 30, 2025
Well you can override everything for the agent, but we also inject
<system-reminders>that are not part of the system promptThat is why you see this behavior
So perhaps we can expose that in some way instead
oribarilan commentedon Oct 30, 2025
oh interesting. i wonder why these are not implemented simply as permissions (that can be overriden). sounds like a non-trivial decision so I'll just rename my agent to something other than
planfor now :)is there anyway to disable a built-in agent?
rekram1-node commentedon Oct 30, 2025
Not rn no
They are implemented as permissions but there are system reminders too (essentially just hidden user messages), because we don't want the agent to try to abuse the tools it does have to get around the idea of being in "plan" mode
I don't think it is non-trivial to add some way to customize around this, just probably not the highest priority atm
ferrao commentedon Oct 30, 2025
Exactly what I did, so I now have a
planand aplanneragent ;)It's not the worse thing in the world, but of course simply being able to disable the built in agents would make it cleaner.
oribarilan commentedon Oct 30, 2025
@rekram1-node if you want to spec a solution i can try to tackle it
(disable built-in agent, avoid plan system reminders if user has plan agent, etc.)
rekram1-node commentedon Oct 30, 2025
the system reminder may need to be thought out a little bit just to see what makes sense but disabled would be fine, maybe add a disabled field to an agent definition similar to how lsp and formatters have it defined
oribarilan commentedon Oct 31, 2025
sounds good. I will take a shot at it, after my currently open PR is resolved :) (#3580)
gw0 commentedon Nov 13, 2025
In OpenCode 1.0.61 one can disable an built-in agent (https://opencode.ai/docs/agents/#disable), but it is still not possible to reuse its name or override it with the agent markdown definition.
I have a feeling everything would be simpler if built-in agents would also be defined with the agent markdown definition instead of with code, then overrides could be supported at the file-loading level.
mintchaos commentedon Jan 6, 2026
I ran into some unexpected behavior around this. I added the atlassian mcp server and wanted to use the built in plan agent to plan out some new tickets with some back and forth. But the plan agent just went ahead and made the ticket right away.
Which now that I know more makes sense because nothing in the default perms denys it from using mcp calls.
I think I could fix it by adding something like this but that doesn't help if I can't override permissions easily.
Furthermore when I asked it to update the ticket after some further planning it had an issue with the mcp calls and then just went ahead and made the changes to the codebase while still in the plan agent. Which was unexpected. This was however on
v1.0.220as I didn't realize that homebrew didn't have the latest. I've since updated.I do wonder if it'd be best to make some jira specific subagents and give them structured perms and prompts.
estenp commentedon Feb 8, 2026
Yeah it's annoying the solution here is to just disable the built in because a) you can't unreserve it's name and b) it doesn't track with the docs which imply over and over you can override the built in's via json or markdown by naming the agent config the same as the built in.
https://opencode.ai/docs/agents/#configure
If disabling and renaming built ins is the solution for the foreseeable future the docs should probably be updated because it's all quite misleading.
Fwiw in my testing:
opencode.json, and overriding "build" to disable writes did not stop it from writing.opencode.json, and overriding "plan" to enable writes did not allow it to write..opencode/agents/build.mdwith write disabled does disable writes..opencode/agents/plan.mdwith write enabled still does not allow writes.github-actions commentedon Apr 10, 2026
To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.