github / github/copilot-cli

Autopilot mode enters infinite loop, draining premium requests until manually cancelled

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

描述

### Describe the bug

After enabling autopilot mode, the assistant entered an infinite self-repeating loop, continuously printing `● Continuing autonomously (1 premium request)` without making any progress or stopping on its own. Each iteration consumed a premium request, and the only way to stop it was to forcefully cancel with `Ctrl+C`.

The loop appeared to be triggered by a disagreement between the assistant and what seemed to be an automated system message repeatedly telling it to call `task_complete`. The assistant correctly refused (since no actual task had been defined), but instead of surfacing this conflict to the user or exiting gracefully, it fell into an unrecoverable loop.

### Affected version

GitHub Copilot v1.0.34
Model: Auto → Claude Haiku 4.5

### Steps to reproduce the behavior

1. Start a GitHub Copilot CLI session (model: Auto, which resolved to Claude Haiku 4.5)
2. Have a general conversation with the assistant (no active coding task)
3. Enable autopilot mode (autopilot mode gets enabled with all permissions)
4. Instruct or wait for the assistant to attempt using `task_complete`
5. The assistant refuses because there is no defined task
6. Observe the session entering an infinite loop, printing `● Continuing autonomously (1 premium request)` on every iteration
7. Each loop iteration consumes one premium request
8. The loop does not stop on its own — requires `Ctrl+C` to terminate

### Expected behavior

When the assistant cannot resolve an ambiguity (e.g., no task is defined and `task_complete` cannot be called), it should:
- Surface the conflict clearly to the user
- Wait for user input rather than looping autonomously
- OR exit autopilot mode gracefully with an explanation

It should NOT silently loop and consume premium requests indefinitely.

### Additional context

The full exported session transcript is attached (Session ID redacted). It includes the assistant's **internal Reasoning blocks**, which clearly show the model was aware it was stuck in a loop — at one point explicitly stating *"This is clearly a loop"* — yet had no mechanism to break out of it or alert the user.

Key observations from the transcript:
- The message `● Continuing autonomously (1 premium request)` appeared **17 times** during the session, meaning **17 premium requests were silently consumed** by the loop with no useful work done
- The loop ran for approximately **2 minutes 30 seconds** (from ~9m to ~11m 39s in the session timeline) before being force-stopped
- The assistant's reasoning was sound throughout; the failure was in the autopilot system having no exit condition
- The only resolution was a forced `Ctrl+C` cancellation by the user

**Environment:**
- **OS:** Windows 11 25H2
- **CPU architecture:** x86_64
- **Terminal emulator:** Windows Terminal
- **Shell:** PowerShell 7.6.0

[copilot-session-xxxx-xxxx-xxxx-xxxx.md](https://github.com/user-attachments/files/26938866/copilot-session-xxxx-xxxx-xxxx-xxxx.md)

贡献指南

打开贡献指南

调研方向

首先,按照列出的 Windows 和 PowerShell 步骤,在 GitHub Copilot CLI v1.0.34 中重现 autopilot 会话,然后检查导出的会话记录,查找重复的继续循环。当未解决的 task_complete 冲突呈现给用户、等待输入,或退出 autopilot 且不再重复消耗 premium requests 时,即表示完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
shell
领域
cli
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
冷清
描述清晰度
基本清楚
新手友好度
45/100

把新 issue 发到你的邮箱

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