fix(prompt): stop plan mode from launching denied subagents
Summary
Automated fix proposed by the Altimate software factory; a maintainer reviews every change.
The problem, fix and criteria below are the agent's own account; check them against the diff.
Problem
The experimental plan-mode reminder told the model to launch general and Plan agents, but the plan agent's permissions deny task calls for general, so those task calls were rejected with a permission error.
Fix
The experimental plan-mode reminder told the plan agent to launch general and Plan agents its own task rule denies; it now points only to explore, and a test reproduces the reported error hash from the plan agent's real ruleset.
Acceptance criteria
- Every subagent named in plan.txt and plan-mode.txt is a subagent-mode agent the plan agent's permissions allow for task
- plan-mode.txt names the explore subagent as the one to launch
Changes
2 files changed, 76 lines added, 2 lines removed.
packages/opencode/src/session/prompt/plan-mode.txtpackages/opencode/test/agent/plan-prompt-subagents.test.ts
New tests
packages/opencode/test/agent/plan-prompt-subagents.test.ts
Independent review: accepted, confidence 0.86
Verification
- Verify job: passed
Summary by cubic
Fixes the plan-mode prompt launching subagents the plan agent's permissions deny, which caused task calls to fail with a permission error.
- Updates
plan-mode.txtto direct the model to launch the explore agent instead of general and Plan agents. - Adds
plan-prompt-subagents.test.ts, which reproduces the reported task denial error hash and verifies both plan prompts only name subagents the plan agent is allowed to launch.