Skip to content

fix(core): clarify Plan mode delegation - #56683

Open
sayedrisat wants to merge 2 commits into
anomalyco:devfrom
sayedrisat:plan-delegation-wording
Open

sayedrisat wants to merge 2 commits into
anomalyco:devfrom
sayedrisat:plan-delegation-wording

Conversation

@sayedrisat

@sayedrisat sayedrisat commented Oct 18, 2026 •

Copy link
Copy Markdown

Issue for this PR

Closes #56674

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Plan mode’s reminder now names the explore subagent as the read-only option for codebase research and warns that general can modify files. The reminder test checks these instructions.

How did you verify your code works?

  • Updated the existing plan reminder test assertions.
  • git diff --check passed.
  • Tests were not run locally.

Screenshots / recordings

Not a UI change.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@github-actions github-actions Bot added the needs:compliance This means the issue will auto-close after 2 hours. label Oct 18, 2026
@github-actions

github-actions Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

This PR doesn't fully meet our contributing guidelines and PR template.

What needs to be fixed:

  • Not all checklist items are checked. Please confirm you have tested locally and have not included unrelated changes.

Please edit this PR description to address the above within 72 hours, or it will be automatically closed.

If you believe this was flagged incorrectly, please let a maintainer know.

@github-actions

Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

@opencode-agent opencode-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new wording is a reasonable fix for #56674, but this PR breaks an existing test. I couldn't verify the behaviour change, because it depends on how real models read the reminder, and only a simulated model is available here.

packages/core/test/plugin/plan.test.ts still expects the old sentence: expect(persisted[0]).toContain("Do not modify any other files") around line 165. bun test test/plugin/plan.test.ts in packages/core now fails that test (11 pass, 1 fail). It passes on the base. Please update that assertion to match the new text.

Also, "read-only subagents" is vague: see the inline comment.

The public API is unchanged.

Related: #55814

Comment thread packages/core/src/plugin/plan.ts Outdated
${directory}

Do not modify any other files or ask a subagent to do so.
Do not modify files outside the Plan directory or delegate file modifications to a subagent. Read-only subagents may be used to explore the codebase.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Read-only subagents" doesn't say which agents those are. Of the built-in agents, only explore is read-only; general can edit (see #55814), and nothing in the reminder lets the model tell them apart. Without a name, a model may pick general for "exploration" and then let it edit. Could the sentence name the agent directly, e.g. "You may use the explore subagent to research the codebase; do not delegate to subagents that can modify files (such as general)."?

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs:compliance This means the issue will auto-close after 2 hours.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

plan: Plan mode reminder discourages all subagent use, not just delegated edits

1 participant