github / github/copilot-cli

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

Đang mở
#1,663 3 bình luận 6 reaction 0 người được giao Xem trên GitHub
area:agents
Ngôn ngữ chính
Shell
Star
11.2k
Fork
1.9k
Merge trung bình
14 giờ 16 phút
Pull request đã merge (30 ngày)
6

Mô tả

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

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.