[PR #8425] fix(session): update plan mode prompt to allow .opencode/plan/*.md writes #12741

Open
opened 2026-02-16 18:17:38 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/8425

State: open
Merged: No


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/*.md are 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/*.md files
  • The permission system (agent.ts:67-70) remains unchanged
**Original Pull Request:** https://github.com/anomalyco/opencode/pull/8425 **State:** open **Merged:** No --- ## 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/*.md` are 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/*.md` files - The permission system (`agent.ts:67-70`) remains unchanged
yindo added the pull-request label 2026-02-16 18:17:38 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#12741