🤖 fix: soften plan-mode no-mutation guidance#3428
Merged
Merged
Conversation
Collaborator
Author
|
@codex review |
|
Codex Review: Didn't find any major issues. What shall we delve into next? ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
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
Plan Mode's "no mutations" instruction was phrased as an absolute, non-overridable rule. This reframes it as guidance: Plan Mode should default to read-only work and avoid implementation, but mutations that don't touch the tracked source tree are fine when implicit to the user's request (e.g. rewriting the plan file, filing a GitHub issue when asked, or downloading a file to analyze for the plan).
Background
Only one restriction is actually enforced at runtime:
file_edit_*is locked to the plan file viavalidatePlanModeAccess(src/node/services/tools/fileCommon.ts). The rest of the "read-only only / norm/mv/cp/ no installs" language was prompt text presented as a hard rule, which over-constrained the planner. It also self-contradicted — the runtime instruction told the agent to "delete the file and start fresh" while simultaneously banningrm.src/common/utils/ui/modeUtils.tsdocuments the intended split: non-overridable workspace facts live in the runtime instruction, while opinionated/overridable guidance lives in the agent spec so users can override it. This change honors that split.Implementation
src/common/utils/ui/modeUtils.ts(getPlanModeInstruction, the non-overridable runtime instruction): removed the absolute READ-ONLY and read-only-bash rules; replaced with the accurate hard fact (file_edit_*locked to the plan file) plus explicit permission to create, rewrite, or delete the plan file itself — resolving the old contradiction.src/node/builtinAgents/plan.md(overridable agent spec): added a "Scope: planning, not implementation" section framing no-mutations as guidance, not a hard rule; clarified that mutating the tracked source tree (project edits, dependency installs, migrations, commits) is for Exec mode, while non-source-tree mutations implicit to the request are permitted. Removed the now-redundant "switch to Exec mode" bullet.docs/agents/index.mdx(viascripts/gen_docs.ts),builtInAgentContent.generated.ts, andbuiltInSkillContent.generated.ts(mux-docs skill snapshot).Validation
bun scripts/gen_docs.ts checkconfirms docs are in sync; agent/skill regeneration is idempotent.modeUtils.test.tsandstreamContextBuilder.test.tsstill pass (they assert onPlan file path:/propose_plan, both retained).Risks
Low — prompt/guidance-only change plus regenerated docs. No runtime enforcement logic was modified; the
file_edit_*lock remains intact.Generated with
mux• Model:anthropic:claude-opus-4-8• Thinking:xhigh• Cost:$2.73