opencode
opencode copied to clipboard
fix(session): update plan mode prompt to allow .opencode/plan/*.md writes
Issue
Plan mode agent refuses to write plan files to .opencode/plan/*.md, even though the permission system explicitly allows these writes (see agent.ts:69).
Root Cause
The plan mode prompt (packages/opencode/src/session/prompt/plan.txt) states "ZERO exceptions", which misleads the agent into believing it cannot write any files, including plan files.
This creates a mismatch between:
-
Permission layer:
.opencode/plan/*.md= "allow" ✅ - Prompt layer: "ZERO exceptions" ❌
Fix
Updated the plan mode prompt to clearly state the ONE exception:
- Plan files at
.opencode/plan/*.mdare explicitly allowed - All other files remain prohibited
The prompt now aligns with the actual permission configuration.
Testing
- Manual testing: Use plan mode, agent can now create/edit
.opencode/plan/*.mdfiles - The permission system (
agent.ts:67-70) remains unchanged