openclaw - 💡(How to fix) Fix Bug: Preflight compaction shares abortSignal with main turn, causing cascading turn abortion

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

OpenClaw preflightCompaction shares the same replyOperation.abortSignal with the main agent turn. When compaction times out or fails, the abort signal propagates to the main turn, killing the entire agent turn.

Root Cause

In agent-runner.runtime-CTlghBhJ.js, both preflightCompaction and runAgentTurnWithFallback() share the same replyOperation.abortSignal. Compaction triggers BEFORE the turn starts (preflight). When it fails, the abort signal kills the whole reply operation.

Fix Action

Fix / Workaround

Relevant config

Applied workaround in agents.defaults.compaction:

  • reserveTokensFloor: 40000
  • timeoutSeconds: 600
  • maxHistoryShare: 0.6
  • notifyUser: true
RAW_BUFFERClick to expand / collapse

Summary

OpenClaw preflightCompaction shares the same replyOperation.abortSignal with the main agent turn. When compaction times out or fails, the abort signal propagates to the main turn, killing the entire agent turn.

Root Cause

In agent-runner.runtime-CTlghBhJ.js, both preflightCompaction and runAgentTurnWithFallback() share the same replyOperation.abortSignal. Compaction triggers BEFORE the turn starts (preflight). When it fails, the abort signal kills the whole reply operation.

Steps to reproduce

  1. OpenClaw gateway running with context close to token limit
  2. Agent turn starts, preflightCompaction triggers (trigger=budget)
  3. Model responds slowly or timeouts
  4. abortSignal fires, entire turn gets aborted mid-execution
  5. Edit tool fails: raw_params truncated, oldText not found

Expected behavior

Preflight compaction failure should be silent. Main turn should continue normally.

Actual behavior

Turn aborted. Edit tool raw_params truncated. Gateway logs: All models failed (3), This operation was aborted, trigger=budget

OpenClaw version

2026.4.15

Operating system

Linux 6.17.0-23-generic (x64)

Install method

docker (gateway container: cio_analyzer)

Model

vllm/whatever (Qwen3.6-35B-A3B-FP8)

Provider / routing chain

vllm -> local deployment

Impact and severity

  • Affected: All agents on gateway (especially cio_analyzer)
  • Severity: High (blocks file editing workflow mid-task)
  • Frequency: Frequent during multi-step editing when context nears token limit
  • Consequence: Incomplete edits, agent confusion

Relevant config

Applied workaround in agents.defaults.compaction:

  • reserveTokensFloor: 40000
  • timeoutSeconds: 600
  • maxHistoryShare: 0.6
  • notifyUser: true

This reduces but does not eliminate the issue.

Additional information

Verified via deep code analysis of agent-runner.runtime-CTlghBhJ.js and model-context-tokens-z5hvDVkk.js bundles. Root cause: shared abortSignal between compaction and main turn. Design fix needed in agent-runner.runtime-CTlghBhJ.js to isolate compaction abort scope.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

Preflight compaction failure should be silent. Main turn should continue normally.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix Bug: Preflight compaction shares abortSignal with main turn, causing cascading turn abortion