Skip to content

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

Closed

Description

@ronkeele

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

Activity

  1. added
    area:context-memoryContext window, memory, compaction, checkpoints, and instruction loading
    area:modelsModel selection, availability, switching, rate limits, and model-specific behavior
    on Apr 20, 2026
  2. added theissue type on Apr 20, 2026
  3. jay-tau commented on Aug 30, 2026

    @jay-tau

    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.

  4. MattPD commented on Aug 31, 2026

    @MattPD

    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.

  5. DavidTeju commented on Sep 2, 2026

    @DavidTeju

    I reproduced this btw

  6. megasilk53 commented on Sep 3, 2026

    @megasilk53

    Reproduces readily with GPT-5.6 Luna · 1.1M context (63%)
    GitHub Copilot CLI 1.0.82 (Linux x86_64)

  7. ja552588 commented on Sep 3, 2026

    @ja552588
  8. PureWeen commented on Sep 8, 2026

    @PureWeen

    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.

  9. copilot-cli-bot commented on Sep 29, 2026

    @copilot-cli-bot

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:context-memoryContext window, memory, compaction, checkpoints, and instruction loadingarea:modelsModel selection, availability, switching, rate limits, and model-specific behavior

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions