Repository navigation
feat(core): extract plan agent into a plugin - #41665
Merged
Merged
Conversation
rekram1-node
force-pushed
the
v2-plan-agent
branch
from
August 11, 2026 05:40
7ed64cf to
e9ee05a
Compare
Move Plan out of opencode.agent into opencode.plan. Keep edit/write/patch advertised and reject those calls from execute.before when Plan is selected.
Use a user-facing Plan description and a per-tool read-only failure message.
Subscribe to session.agent.selected and admit a synthetic system reminder when entering or leaving Plan, without waking the session.
Rewrite enter and leave synthetics to state the read-only constraint and its removal without extra workflow instructions.
rekram1-node
force-pushed
the
v2-plan-agent
branch
from
August 11, 2026 15:53
b295fb2 to
71f7b35
Compare
Add optional previous to session.agent.selected so plugins can see both agents without reading session messages.
State that Plan does not change on user intent, and revoke prior Plan instructions on leave without promising edit access.
Admit the Plan enter synthetic when a session is created with the plan agent, not only when switching into Plan later.
Move enter/leave choice out of the event stream so the subscriber only admits the synthetic.
1 task done
jinhuang712
pushed a commit
to jinhuang712/opencode
that referenced
this pull request
Sep 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
opencode.agentinto its own internal plugin,opencode.plan.edit * deny, so edit/write/patch stay in the advertised tool schema.execute.beforewhen Plan is selected, returning aToolFailureto the model.session.agent.selected, using the durable predecessor contract merged in feat(session): persist previous selections #41771.Test plan
plugins: ["-opencode.plan"]removes the Plan agent