Skip to content

Compaction can return an empty summary while leaving the over-cap history unchanged #379

Description

@yxlyx

Summary

Auto-compaction failed in the session Using Codex image generation (worktree /Users/limyuxi/my-website) at approximately 218k context tokens:

[compacting ~218185 tokens…]
[compaction failed: empty summary, history unchanged]

The session then remained usable only with the original, oversized history; the next visible event was a tool call. No non-empty compacted summary replaced the history.

Evidence

  • Provider/model: codex / gpt-5.6-luna
  • Session file: .graff/sessions/using-codex-image-generation.session.json
  • Session title: Using Codex image generation
  • Session state after the failure still recorded context_tokens=212546 and 730 messages.
  • Trace evidence from .graff/traces/bcaa6e126cd944f6.jsonl shows compaction-sized requests at context 64930 followed immediately by context values 218185 and 218862, rather than a durable reduction of the active history. The trace run ID is bcaa6e126cd944f6 and its session ID is c6e9e2f02f3bc8b9bdfc98891d43764c.

This is distinct from a transport WriteFailed: the observed user-facing failure specifically says the summary was empty and that history was unchanged.

Expected behavior

When compaction is triggered, the harness should either:

  1. atomically replace the old history with a validated, non-empty summary and materially lower the context count; or
  2. keep the old history but clearly enter a recoverable fallback (emergency trim/retry) before sending another model request.

An empty summary must never be accepted as a completed compaction result, and a failed compaction should not leave the session silently operating at the same over-cap context.

Impact

Long-running sessions can repeatedly hit the compaction threshold, fail to reduce context, and eventually become unable to send further turns or require manual session recovery. The failure also makes it unclear whether the user's conversation state was safely summarized.

Related prior compaction reports: #88 and #163. This report covers the newer empty-summary/history-unchanged failure mode.

Activity

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions