github / github/copilot-cli

Bug: Agent implements changes during Plan Mode instead of only planning

Offen
#1,663 3 Kommentare 6 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
area:agents
Vorherrschende Sprache
Shell
Sterne
11.2k
Forks
1.9k
Ø Merge
14 Std. 16 Min.
Gemergte PRs (30 T.)
6

Beschreibung

## Bug Description

When a user message is prefixed with `[[PLAN]]`, the agent is supposed to **only** analyze the codebase, ask clarifying questions, and write a plan to `plan.md` — without making any code changes.

However, during a recent session, the agent **implemented the full feature** (edited source files, created configuration, ran tests) while still in Plan Mode.

## Steps to Reproduce

1. Send a message prefixed with `[[PLAN]]` describing a new feature request.
2. The agent correctly creates `plan.md` and inserts todos into the SQL database.
3. The agent then **proceeds to implement** the feature (edits files, runs tests, marks todos as `done`) **without the user switching out of Plan Mode** or explicitly saying "start" / "implement it".

## Expected Behavior

In Plan Mode, the agent should:
- Analyze the codebase
- Ask clarifying questions if needed
- Write the plan to the session plan file
- **Stop** — and wait for the user to explicitly trigger implementation (e.g., by switching out of Plan Mode with Shift+Tab and saying "start")

## Actual Behavior

The agent created the plan **and** immediately implemented it within the same Plan Mode turn, making edits to:
- `src/config/environment.js`
- `src/services/ReverseGeocoder.js`
- `.env`
- `.env.example`

It also ran tests and marked all todos as `done` — all while still in `[[PLAN]]` mode.

## Session Context

- **Agent version**: 0.0.416
- **Model**: Claude Sonnet 4.6 (`claude-sonnet-4.6`)
- **Trigger**: The user replied "Implement the new feature and configure .env file" to the plan summary prompt (via the `exit_plan_mode` tool's feedback mechanism), which the agent interpreted as permission to implement rather than staying in plan mode and letting the user switch modes manually.

## Notes

The root cause may be that the `exit_plan_mode` tool's "User feedback" path allowed the agent to interpret inline feedback as an out-of-plan-mode instruction. The plan mode instructions state:

> Do NOT start implementing unless the user explicitly asks (e.g., "start", "get to work", "implement it"). When they do, suggest switching out of plan mode with Shift+Tab (if still in plan mode), and read plan.md first.

The agent received "Implement the new feature" as feedback on the plan approval and acted on it immediately instead of suggesting the user switch modes first.

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.