github / github/copilot-cli

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

未关闭
#1,663 3 条评论 6 个 reaction 已指派 0 人 在 GitHub 查看
area:agents
主要语言
Shell
星标
11.2k
派生
1.9k
平均合并
14 小时 16 分钟
30 天内合并 PR
6

描述

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

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。