github / github/copilot-cli

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

Aperta
#1,663 3 commenti 6 reazioni 0 assegnatari Vedi su GitHub
area:agents
Lingua principale
Shell
Stelle
11.2k
Fork
1.9k
Merge medio
14h 16m
PR unite (30g)
6

Descrizione

## 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.

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.