Skip to content

Compaction as a visible, checkpointed, recoverable event #318

Closed

Description

@currentbits

Context-loss research: compaction silently destroys working state and constraints (rules followed before, violated ~100% after; even 'reload after compaction' instructions fail), compaction fails outright under some models (~80% failure reported for GPT-5.5 Codex, bricking sessions), and users cannot tell when it happened.

Orchestrator-side answers, all things incumbents cannot easily do: (1) automatic checkpoint before compaction; (2) a visible compaction event in the thread with what-survives detail; (3) post-compaction re-injection of constraints, memory, and goal state (never routed through the summarizer; the Governance Decay paper shows prompt-level pinning is not enough — re-inject at every turn boundary); (4) detect failed/repeated compaction loops and offer recovery (resume last actionable request).

Activity

  1. added
    enhancement
    plan:todo
    on Aug 17, 2026
  2. currentbits commented on Aug 18, 2026

    @currentbits
    OwnerAuthor

    Deep-dive (Zed agent settings): auto_compact threshold accepts three forms — a percent of the context window, a positive int (compact after N tokens used), or a NEGATIVE int (compact when fewer than N tokens REMAIN). Only auto-compacts for windows >= 80k tokens; below that, push New-From-Summary instead.

  3. currentbits commented on Aug 18, 2026

    @currentbits
    OwnerAuthor

    From the CLI doc-mines: (1) opencode's compaction prompt hook — plugins can inject domain state into the continuation prompt (in multi-agent swarms: which files are being modified and by whom) or replace it entirely. (2) Kimi's cache-expiry hint — resuming a long-idle session warns that the provider prompt cache has likely expired and offers compact-or-new; switching model/effort warns it invalidates cache. Both belong in the compaction-event UX.

  4. added a commit that references this issue on Oct 6, 2026
  5. currentbits commented on Oct 9, 2026

    @currentbits
    OwnerAuthor

    Gap pass #1532 checked this against main @24d3c36b (v0.24.0). #1495 shipped compaction for Claude and Codex, plus a visible "Context compacted (pre → post tokens)" event in the thread (electron/compaction.js:17-60).

    Still missing, so keeping this open:

    1. No automatic checkpoint before compaction.
    2. The event shows token counts only, not what survived.
    3. Constraints, memory and goals are not re-injected after compaction.
    4. Failed or repeated compaction loops are not detected, and there is no recovery offer.

    Also missing: a compaction threshold setting and a warning when the prompt cache has expired.

  6. added
    plan:doing
    plan:done
    and removed
    plan:todo
    plan:doing
    on Oct 9, 2026
  7. currentbits commented on Oct 9, 2026

    @currentbits
    OwnerAuthor

    Shipped in 0.24.0: native and automatic compaction post a visible "Context compacted" event and reset the context ring (compaction.js, 4739a3b, 30a054b). Closing in the 2026-10-09 board cleanup (#1532).

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

    enhancementplan:done

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions