github / github/copilot-cli

Session hangs after work appears complete; Escape recovery enters permanent "Cancelling"

Đang mở
#2,703 1 bình luận 2 reaction 0 người được giao Xem trên GitHub
area:input-keyboard area:sessions
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ả

### Describe the bug

After a turn appears to finish its work, the CLI can hang in a busy/thinking state and never return to a usable prompt. The session is already stuck before any user intervention.

Pressing **Escape** to try to recover from that stuck state makes things worse: the UI transitions into a permanent **`Cancelling`** state. Once there, normal input and slash commands stop working entirely, and the only recovery is killing and restarting the process.

This report covers two compounding failures:

1. **Post-completion hang** — the session does not return to the prompt after work appears complete
2. **Escape recovery failure** — pressing Escape while stuck enters permanent `Cancelling` instead of recovering

### Known observations

- visible work appeared complete, but the CLI did not return to a normal ready prompt
- after the session remained stuck for a while, pressing **Escape** moved the UI into **`Cancelling`**
- once in that state, normal input and slash commands no longer worked
- the session had to be restarted/killed to recover

### Observed sequence

1. Start an interactive Copilot CLI session.
2. In at least one observed case, the session remained busy for a long time.
3. The visible work appeared complete, but the CLI did not return to a normal ready prompt.
4. After waiting and seeing no recovery, press **Escape** to try to recover or cancel the stuck state.
5. The UI switches to **`Cancelling`** and does not recover.
6. Normal input and slash commands no longer work.

**Reproduction status:** Intermittent. No minimal deterministic repro is known yet. The conditions that trigger the initial post-completion hang have not been isolated.

### Expected behavior

When work is complete, the CLI should reliably return to a usable prompt instead of remaining stuck in a busy state.

If **Escape** is pressed after the session is already stuck, it should either:

- cleanly recover or cancel, or
- safely no-op while preserving input

It should not transition into a permanent **`Cancelling`** state that disables further interaction.

### Affected version

GitHub Copilot CLI **1.0.25**

### Environment

- **OS:** Linux

### Potentially relevant context (not confirmed triggers)

- observed in an interactive / non-autopilot session
- the session may have involved background work or sub-agent activity, but that has **not** been isolated as the trigger
- the primary failure appears to be the post-completion stuck state; the failed Escape recovery appears to be a secondary consequence

### Related issues / lineage

- **#405** — strongest older precedent for sessions hanging after task completion
- **#2617** — narrower adjacent post-completion stale-status report that was closed as fixed in v1.0.21
- **#2557** and **#2502** — similar stuck-`Cancelling` outcomes, but during active cancellation rather than after an already-stuck post-completion state
- **#2681** — related Esc/input-state restoration bug on a different path

Issues in this symptom family were closed as fixed through v1.0.21, but this was observed on v1.0.25. The exact relationship is still uncertain.

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

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

Hướng nghiên cứu

Bắt đầu với một phiên Copilot CLI tương tác trên Linux và tái hiện trình tự đã được báo cáo: chờ đến khi có vẻ như đã hoàn tất, sau đó nhấn Escape trong khi phiên vẫn đang bận. Theo dõi quá trình chuyển sang Cancelling và so sánh với hiện tượng treo sau khi hoàn tất được mô tả ở đây. Được xem là hoàn tất khi CLI trở lại prompt có thể sử dụng sau khi công việc hoàn thành, và Escape hoặc khôi phục an toàn hoặc để đầu vào vẫn có thể sử dụng.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
linux, shell
Lĩnh vực
cli
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Ít trao đổi
Độ rõ ràng
Cần làm rõ
Mức phù hợp với người mới
35/100

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.