Skip to content

[Bug] Compaction safeguard loop blocks cron lane — isolated sessions never execute #41981

@Roypoe

Description

@Roypoe

Bug Description

Isolated cron sessions are stuck in a compaction loop that blocks the entire cron lane. The compaction safeguard fires repeatedly ("cancelling compaction with no real conversation messages to summarize"), but each attempt occupies the lane slot, preventing the actual cron job from executing.

Steps to Reproduce

  1. Set up a simple cron job with sessionTarget: "isolated", lightContext: true, model claude-haiku-4-5
  2. Job is a simple exec call (runs in 2s when called directly)
  3. Observe that the job times out every run (120s, 300s — doesn't matter)

Expected Behavior

Isolated cron session should execute the agent turn without triggering compaction (it's a fresh session with no history).

Actual Behavior

The cron lane gets blocked. Logs show:

[compaction-safeguard] Compaction safeguard: cancelling compaction with no real conversation messages to summarize.
[compaction-safeguard] Compaction safeguard: cancelling compaction with no real conversation messages to summarize.
[diagnostic] lane wait exceeded: lane=cron waitedMs=299967 queueAhead=0
[agent/embedded] Profile anthropic:apikey timed out. Trying next account...
[agent/embedded] Profile anthropic:manual timed out. Trying next account...

The compaction safeguard cancels repeatedly (sometimes multiple times per second), blocking the lane. The actual LLM call is never made — direct API calls via curl work in <2s.

Key Evidence

  • Direct API test: curl to Anthropic API returns in <2s ✅
  • Interactive sessions: Work fine (this bug report is written by the agent in an interactive session)
  • All cron sessions: Fail with lane timeout
  • Pattern: queueAhead=1 when compaction blocks, then queueAhead=0 when the cron job itself waits

Environment

  • OpenClaw 2026.3.8 (3caab92) — latest
  • macOS ARM64 (MacBook Pro)
  • Node v25.6.1
  • 47 active sessions (recently cleaned from 448)
  • Multiple Slack workspaces connected (frequent WebSocket pong timeouts in parallel)

Possibly Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions