Skip to content

feat(core): extract plan agent into a plugin - #41665

Merged
rekram1-node merged 8 commits into
v2from
v2-plan-agent
Aug 11, 2026
Merged

rekram1-node merged 8 commits into
v2from
v2-plan-agent

Conversation

@rekram1-node

@rekram1-node rekram1-node commented Aug 11, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Extract the built-in Plan agent from opencode.agent into its own internal plugin, opencode.plan.
  • Stop using edit * deny, so edit/write/patch stay in the advertised tool schema.
  • Reject those tools from execute.before when Plan is selected, returning a ToolFailure to the model.
  • Inject read-only enter/leave reminders from session.agent.selected, using the durable predecessor contract merged in feat(session): persist previous selections #41771.

Test plan

  • Switch a session to Plan and confirm edit/write/patch still appear in the tool list
  • Call edit, write, or patch under Plan and confirm the model gets a write-disabled tool error
  • Confirm Build can still edit/write/patch
  • Confirm plugins: ["-opencode.plan"] removes the Plan agent

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.
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.
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.

1 participant