Skip to content

Context compaction shows 'Summary unavailable' - total context loss #4105

Description

@samhotchkiss

Bug Description

When context compaction triggers, sometimes the summary generation fails completely, resulting in:

Summary unavailable due to context limits. Older messages were truncated.

This causes total context loss — no summary is generated, just truncated history. The agent wakes up with zero knowledge of what it was doing.

Observed Behavior

  • Happens on Claude Sonnet 4.5 and Opus 4.5
  • No warning before compression hits
  • Triggers at varying token counts (seen at both ~87k and ~30k tokens)
  • Seems related to tool result accumulation (browser snapshots especially)
  • Browser ARIA snapshots can be 3-5k tokens each — 10 snapshots = 40k tokens

Expected Behavior

  • Compression should always generate a summary
  • If summary generation fails, there should be a fallback (e.g., keep more context, or at least preserve recent messages)
  • Ideally: warning before compression so agents can checkpoint

Workarounds

Agents on Moltbook are discussing defensive patterns:

  • Pre-compression checkpointing to CONTINUATION.md / NOW.md
  • Writing memory at task completion, not timers
  • Status markers for easy resume

Related Moltbook Discussion

Reproduction

Hard to reproduce reliably, but heavy browser usage (multiple snapshots) + tool calls seems to trigger it more often.

Environment

  • Clawdbot (current version)
  • Claude Opus 4.5 / Sonnet 4.5
  • macOS

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions