Compaction failed: received empty response from model (3x retry, manual /compact on Opus 4.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
- Start a session using Claude Opus 4.6.
- Work through a task (commit pushed, environment reloaded mid-session — MCP servers, extensions, hooks, agents, skills all reloaded at the same time).
- Run
/compactmanually. - Observe three consecutive
Compaction failed: received empty response from modelerrors.
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
/compactcommand - 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
/compactworked — 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)
I can reproduce this on a substantially newer version, with evidence that the model response is not actually empty.
Environment
- Copilot CLI
1.0.82 - Linux x86_64
- Manual
/compact
Two consecutive reproductions
| Attempt | Context before compact | Prompt tokens | Completion tokens | Final text returned |
|---|---|---|---|---|
| 1 | 415,001 | 397,306 | 10,172 | 26,188 characters |
| 2 | 502,122 | 487,598 | 8,428 | 21,823 characters |
Both /responses calls completed normally over HTTP with finish_reason: stop, responses_message_status: completed, and a non-empty final_answer. The returned compaction text was structurally valid (<overview>, <next_steps>, and <checkpoint_title> sections).
The streamed event sequence contained several reasoning-only assistant messages with empty content, followed by one final assistant message with the non-empty summary. Despite that, the native compactionRunModelCall path returned Compaction failed: received empty response from model, so the summary was not applied.
The session remained usable and its original transcript was preserved. This looks like stream aggregation selecting an empty reasoning message instead of the later non-empty final-answer message, rather than the model returning no response.
I reproduced this behavior in two Copilot CLI releases: 1.0.81 and 1.0.82. In the 1.0.82 run, three streamed assistant messages contained reasoning content but no text before a complete 22,877-character final answer. The CLI still logged received empty response from model 343 ms after that answer. My next /compact succeeded after I switched from GPT-5.6 Sol to Claude Opus 5, then failed after I switched back. I have also seen /compact fail with Claude Opus 5 and succeed after a switch to GPT-5.6 Sol. The pattern suggests that the CLI may be combining streamed messages incorrectly. Changing models and retrying has worked in either direction. No particular model has been consistently successful.
I reproduced this btw
Reproduces readily with GPT-5.6 Luna · 1.1M context (63%) GitHub Copilot CLI 1.0.82 (Linux x86_64)
@.***
On Fri, 4 Sept 2026, 12:20 am Erik Strack, @.***> wrote:
megasilk53 left a comment (github/copilot-cli#2861) https://github.com/github/copilot-cli/issues/2861#issuecomment-5530182103
Reproduces readily with GPT-5.6 Luna · 1.1M context (63%) GitHub Copilot CLI 1.0.82 (Linux x86_64)
— Reply to this email directly, view it on GitHub https://github.com/github/copilot-cli/issues/2861?email_source=notifications&email_token=B4FO3EAFD27FDVZRTWCGRSD5NGZAPA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTKNJTGAYTQMRRGAZ2M4TFMFZW63VKON2WE43DOJUWEZLEUVSXMZLOOSWGM33PORSXEX3DNRUWG2Y#issuecomment-5530182103, or unsubscribe https://github.com/notifications/unsubscribe-auth/B4FO3EB4MDVA3EJKSB657XT5NGZAPAVCNFSNUABFKJSXA33TNF2G64TZHM2TQNJYGYYDMNRUHNEXG43VMU5TIMRZHA3TKNBWGUZ2C5QC . Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS https://github.com/notifications/mobile/ios/B4FO3ECBFIH7B4WPFNVM5F35NGZAPA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTKNJTGAYTQMRRGAZ2M4TFMFZW63VKON2WE43DOJUWEZLEUVSXMZLOOSVGM33PORSXEX3JN5ZQ and Android https://github.com/notifications/mobile/android/B4FO3EEXBD324L775MXSPIL5NGZAPA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTKNJTGAYTQMRRGAZ2M4TFMFZW63VKON2WE43DOJUWEZLEUVSXMZLOOSXGM33PORSXEX3BNZSHE33JMQ. Download it today! You are receiving this because you are subscribed to this thread.Message ID: @.***>
Additional reproduction with GPT-6 Astra long context, observed through GitHub Copilot App with Copilot CLI 1.0.84-1.
- A manual compaction began with approximately 448k tokens, within the model's advertised long-context capacity.
- After approximately 6m43s, it failed with
Compaction failed: received empty response from model. - The session remained recoverable and its transcript was preserved.
- A later compaction whose model call began on GPT-6 Astra succeeded at 252,130 pre-compaction tokens, reducing the history to 67,203 tokens (184,927 tokens removed). It took approximately 10m36s.
- A compaction using another model also succeeded with a larger input than the failed Astra attempt.
This was not accompanied by a 413 or serialized-request-size error, so it appears distinct from the 5 MB request-limit failure mode. The contrasting failed and successful Astra attempts suggest the issue is intermittent or input/stream-shape dependent rather than a simple advertised-context-limit overflow.
I did not capture the raw /responses stream for the failed attempt, so I cannot independently confirm whether a valid final answer was present and later discarded. However, the exact CLI error and the model-switch recovery behavior align with the stream-aggregation evidence already reported in this thread.
This appears to be resolved as of GitHub Copilot CLI v1.0.89. Please update to that release or a newer stable version. We're closing this as completed. If it still happens, please comment with your version and reproduction steps.