Bug Fix April 16, 2026

OpenClaw Auto-Compaction Timeout: Why a Successful Compaction Still Ends in /new

Auto-compaction is supposed to save long sessions from context overflow. But on embedded agent sessions, OpenClaw can successfully compact the session, then retry the original prompt โ€” and then hit a 120-second LLM idle timeout on the retry, exhausting all retries and forcing a /new reset anyway. The compaction worked. The session was killed regardless.

The Failure Sequence

Issue #67750 documents the exact chain of events:

  1. Session hits context overflow threshold
  2. OpenClaw detects overflow, initiates auto-compaction
  3. Compaction runs successfully โ€” old messages summarized, context trimmed
  4. OpenClaw retries the original prompt with the compacted context
  5. The retried LLM call hits a 120-second idle timeout (provider taking too long)
  6. OpenClaw exhausts retry attempts
  7. Falls back to /new โ€” session reset, context lost

From the user's perspective: agent stops mid-task, session resets, all context is gone โ€” same result as if compaction had never run. But compaction did run successfully. The failure is in the retry layer, not the compaction itself.

Why the Retry Times Out

Compaction runs a silent LLM summarization turn before the retry. On long sessions, that summarization call can itself be slow. By the time the original prompt retry fires, the provider may already be under load โ€” and the retry inherits the same 120-second timeout window with no fresh budget. A slow summarization pass + slow retry = timeout.

Fix #1 โ€” Reduce Context Overhead Before Sessions Get Long

The best fix is preventing the situation. Keep bootstrap files lean so compaction runs faster and the retry has more timeout headroom:

See our context bloat guide for the full workflow.

Fix #2 โ€” Increase the LLM Idle Timeout

If your provider is legitimately slow (local Ollama, VPS with limited CPU, or a congested API endpoint), increasing the timeout gives the retry more room:

// openclaw.json
{
  "llm": {
    "idleTimeoutMs": 300000  // 5 minutes instead of 120 seconds
  }
}

Trade-off: hung requests will take longer to surface as errors. Only increase this if you know your provider is slow but reliable โ€” not if you're on a fast API that shouldn't need more than 2 minutes.

Fix #3 โ€” Use /compact Manually Before Sessions Get Critical

Don't wait for auto-compaction to trigger at overflow. Run /compact proactively when sessions get long โ€” before the context limit is hit. This gives compaction and the subsequent retry their full timeout budget rather than running under pressure.

/compact

A good rule: if a session has been running for more than 2 hours or 50+ turns, run /compact manually during a natural pause in work.

Fix #4 โ€” Use Lossless Claw for Long Sessions

Lossless Claw replaces OpenClaw's compaction entirely with a DAG-based system that never hits the overflow threshold in the same way. If you're regularly running sessions long enough to trigger this bug, it's worth installing.

TL;DR

Losing session context from compaction failures?

ClawReady configures workspace architecture and compaction settings to minimize context loss โ€” including Lossless Claw setup for long-running agent workflows.

Book a Free Call โ†’