Skip to content

compaction: "Compaction produced no summary" kills every prompt in a long session #56857

Closed as not planned

Description

@BenAtCCC

Summary

In a long-running session that had already compacted successfully many times, automatic compaction began failing with Session.StepFailedError: Compaction produced no summary. Every new prompt now aborts before the user's message is processed — the session is permanently unusable and the failure is not surfaced as an actionable error.

Environment

  • opencode version: 2.0.32
  • OS: Windows 11 x64 (Microsoft Windows [Version 10.0.26300.9711])
  • Terminal: VS Code integrated terminal (TERM_PROGRAM=vscode, TERM=xterm-256color, COLORTERM=truecolor)
  • Shell: cmd.exe
  • Install/channel: latest release channel; native Windows installer (%LOCALAPPDATA%\opencode\bin\opencode.exe); update check reports up-to-date
  • Active plugins: none (global config is only {"$schema": "https://opencode.ai/config.json"})

Reproduction

Not yet reduced to a minimal case, but 100% reproducible on the affected session:

  1. Use one session heavily over several days with many turns that produce very large tool outputs, so it compacts repeatedly. This session compacted ~19 times (~1,650 stored messages).
  2. Send any new message.
  3. Automatic compaction runs first, completes without producing a summary, and the whole turn aborts.

The user's message is never sent to the model; the TUI appears to just do nothing / fail. Retrying reproduces it every time (three attempts across ~12 hours).

Expected Behavior

Either compaction produces a summary and the prompt is processed, or a clear, actionable error is surfaced. An empty compaction summary should not silently make a session permanently unusable.

Actual Behavior

Each attempt logs:

timestamp=2026-10-18T17:32:16.964Z level=ERROR run=<run> message="Failed to drain Session" cause="Session.StepFailedError: Compaction produced no summary
    at <anonymous> (B:/~BUN/root/chunk-z20sjgqk.js:382:3088)
    at SessionRunner.runStep (B:/~BUN/root/chunk-z20sjgqk.js:382:2672)
    at SessionRunner.runStep (definition) (B:/~BUN/root/chunk-z20sjgqk.js:382:2826)
    at SessionRunner.drain (B:/~BUN/root/chunk-4e2rqd16.js:18:2552)
    at SessionRunner.drain (definition) (B:/~BUN/root/chunk-z20sjgqk.js:382:516)
    at ServerProcess.start (B:/~BUN/root/chunk-94gxrctf.js:2:7603)
    at ServerProcess.start (definition) (B:/~BUN/root/chunk-z20sjgqk.js:453:25665)" role=server

Same error at 2026-10-18T05:08:04.418Z and 2026-10-18T05:14:07.065Z.

After each failure the session is left idle with a failed outcome. Observed in the session database:

  • session_v2.time_idle set and idle_outcome = 'failed', resume_attempts = 0
  • message sequence per attempt: user → compaction → idle, i.e. a compaction message is recorded even though no summary was produced

Additional Context

  • Not a service or connectivity problem: opencode service status is healthy, the version is current, and other sessions on the same model keep working.
  • No agent=compaction stream record appears on the failing attempts. Successful compactions in the same session earlier (e.g. 10-13 through 10-16) logged:
    level=INFO message=stream providerID=opencode modelID=<model> small=false agent=compaction mode=primary
    On the failing attempts no such line is logged — compaction appears to fail without reaching a provider stream, and no underlying provider/stream error is recorded (no stream error entries for these attempts either).
  • Compaction uses the session's own model (per the V2 compaction docs), and that model had already summarised this same session successfully ~17 times, so a permanently unsupported or misconfigured model seems unlikely.
  • Hypothesis: the session's history is enormous (many very large tool outputs), so compaction is on the "shortened text version" path; if the model returns an empty summary there, the result is treated as fatal (StepFailedError) instead of retried or reported. Logging the raw compaction response and treating an empty summary as retryable would help.
  • Workarounds tried: retrying the prompt (fails every time); waiting ~12 hours and retrying (fails). The only recovery was exporting the session and starting a new one. Manual POST /api/session/{id}/compact was not attempted.
  • Sensitive data redacted: session id, local paths, workspace contents, run ids.

Activity

  1. opencode-agent commented on Oct 18, 2026

    @opencode-agent
    Contributor

    Thanks for the detailed report and logs.

    This error only happens when the model answers the summary request, and then one follow-up nudge, with no text both times. That can mean it put the summary only in its reasoning, answered with a tool call, or returned nothing. Which of these happened depends on the model, and the model is redacted in your report. Could you share:

    1. The model ID used by this session (e.g. opencode/<model>) and its reasoning/variant setting, if you changed it.
    2. Whether /compact on the stuck session (if you still have it) fails with the same error.
    3. Any log lines around one of the failing attempts that mention compaction, stream or the model, e.g. from 2026-10-18T17:32, with ids redacted as before.

    You can reply here or edit the issue. If you edit it, please also leave a short comment saying you've updated it, so we know when you're done.

    These issues may already cover this, ordered from most to least likely:

  2. opencode-agent commented on Oct 21, 2026

    @opencode-agent
    Contributor

    We're closing this for now because we haven't heard back. Without the model ID (it's redacted in the log), we can't tell why compaction got no summary text back, or whether this is the same problem as #53242. In #53242 the summary request still includes the session's tools, so the model answers with a tool call and no text. A fix is open in #53370.

    If it happens again, please comment here with the model ID, whether /compact fails the same way, and the log lines around a failed attempt. We can reopen it then. Thanks for the detailed report.

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions