github / github/copilot-cli

Compaction failed: received empty response from model (3x retry, manual /compact on Opus 4.6)

未關閉
#2,861 6 則留言 5 個 reaction 已指派 0 人 在 GitHub 檢視
area:context-memory area:models
主要語言
Shell
星號
11.2k
分支
1.9k
平均合併
14 小時 16 分鐘
30 天內合併 PR
6

描述

### Describe the bug

Running `/compact` manually in a short session (< 30 turns) on Claude Opus 4.6 produces three consecutive failures:

```
X Compaction Failed: Error: Compaction failed: received empty response from model
X Compaction Failed: Error: Compaction failed: received empty response from model
X Compaction Failed: Error: Compaction failed: received empty response from model
```

The session remained usable — after one additional turn (wasting a premium request), a subsequent `/compact` succeeded normally.

### Affected version

1.0.34

### Steps to reproduce the behavior

1. Start a session using Claude Opus 4.6.
2. Work through a task (commit pushed, environment reloaded mid-session — MCP servers, extensions, hooks, agents, skills all reloaded at the same time).
3. Run `/compact` manually.
4. Observe three consecutive `Compaction failed: received empty response from model` errors.

### Expected behavior

`/compact` should succeed, or at minimum degrade gracefully (e.g., retry with a different summarization strategy rather than repeating the same failing call three times).

### Additional context

- **Model**: Claude Opus 4.6
- **Session length**: Short (< 30 turns)
- **Trigger**: Manual `/compact` command
- **Environment**: Windows, VS Code Insiders connected, 2 custom instructions, 1 extension, 1 hook, 6 agents, 14 skills
- **MCP servers**: 0 connected at the time of failure (had just reloaded)
- **Recovery**: Session continued normally after one additional turn, then `/compact` worked — but this wasted a premium request on the recovery turn.

The environment reload (`MCP Servers reloaded: 0 servers connected`, `mermaid-render extension loaded`, `Environment loaded: ...`) occurred immediately before the compaction failures, which may be relevant — the compaction model may have received an unusual message history containing reload notifications.

### Related issues

- #2500 — Compaction killed the session (different symptom but same area)
- #2553 — Compaction fails after model switching (different root cause)
- #2333 — Request to toggle off auto-compaction (workaround request)

貢獻指南

開啟貢獻指南

研究方向

Start by reproducing the manual /compact failure with Claude Opus 4.6 after the described environment reload, then trace the compaction request and its retry handling. Check how an empty model response is processed; done means the scenario no longer produces three consecutive failures and degrades gracefully when compaction cannot complete.

由索引模型根據 Issue 內容生成。

評估

領域
ai, cli
Issue 類型
缺陷
難度
4/5
預估耗時
3-5 天
活躍度
活躍
描述清晰度
基本清楚
新手友好度
48/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。