Skip to content

Stall detector aborts long tool-call chains that are actively making progress (2026.5.26) #87397

Closed

Description

@dprrwt

Summary

Running OpenClaw 2026.5.26 (npm, Windows 10). During an agent task involving a long uninterrupted sequence of Write tool calls (~21 files written across 3 new workspace directories under ~/.openclaw/workspace-<name>/), the diagnostic watcher classified the session as active_work_without_progress and force-aborted the embedded run at the default 360s abort threshold (max(5min, stuckSessionWarnMs × 3)), even though tool calls were firing continuously and committing to disk the entire time.

Logs

00:57:00 [agent/cli-backend] cli exec: provider=claude-cli model=opus promptChars=111 trigger=user useResume=true session=present resumeSession=a683dcc44eeb reuse=reusable historyPrompt=present
00:57:00 [agent/cli-backend] claude live session reuse: provider=claude-cli model=claude-opus-4-7
00:59:07 [diagnostic] stalled session: sessionId=unknown sessionKey=agent:main:main state=processing age=128s queueDepth=1 reason=active_work_without_progress classification=stalled_agent_run activeWorkKind=embedded_run lastProgress=embedded_run:started lastProgressAge=128s recovery=none
00:59:37 [diagnostic] stalled session: ... age=158s ... lastProgress=embedded_run:started lastProgressAge=158s recovery=none
00:00:07 [diagnostic] stalled session: ... age=188s ... recovery=none
... (repeats every 30s, ages 218/248/278/308/338s, all lastProgress=embedded_run:started) ...
01:03:07 [diagnostic] stalled session: ... age=368s ... lastProgress=embedded_run:started lastProgressAge=368s recovery=checking
01:03:07 [agent/cli-backend] claude live session close: provider=claude-cli model=claude-opus-4-7 reason=abort
01:03:07 [agent/cli-backend] claude live session turn failed: provider=claude-cli model=claude-opus-4-7 durationMs=367432 error=AbortError
01:03:07 [diagnostic] stuck session recovery: sessionId=37f0eb00-d091-4693-84df-40f242152bd7 sessionKey=agent:main:main age=368s action=abort_embedded_run aborted=true drained=true released=0
01:03:07 [diagnostic] stuck session recovery outcome: status=aborted action=abort_embedded_run sessionId=37f0eb00-d091-4693-84df-40f242152bd7 sessionKey=agent:main:main activeSessionId=37f0eb00-d091-4693-84df-40f242152bd7 activeWorkKind=embedded_run lane=session:agent:main:main aborted=true drained=true forceCleared=false released=0

Note lastProgress stays pinned at embedded_run:started for the entire 368-second window — the diagnostic watcher never sees any progress event, even though Write tool calls were executing throughout.

Expected

Active tool-call execution should count as forward progress. The embedded run is not stalled — it is doing exactly what it was asked to do — but the watcher's progress signal only updates on coarser events (e.g. embedded_run:started/turn boundaries), missing all the work in between.

Actual

lastProgress remains at embedded_run:started for the full duration. At 360s the recovery path fires abortAndDrainEmbeddedPiRun and the live Claude CLI session is terminated mid-flow with error=AbortError. The user-facing turn appears to end abruptly; the next user message is required to resume.

Reproduction shape

Any agent turn that performs a long uninterrupted sequence of tool calls (file writes, multi-step refactors, large restoration tasks) without intervening model turns will hit this. In this case: writing IDENTITY/USER/SOUL/TOOLS files across three new sibling-agent workspace directories.

Workaround

Raise diagnostics.stuckSessionAbortMs in openclaw.json. Setting it to 1800000 (30 min) eliminates the kill in normal long-tool-call runs. But the underlying heuristic gap remains: tool-call activity does not register as progress to the stall detector, so the workaround just moves the cliff.

Related

Suggested directions (for maintainer judgment)

  1. Emit a progress event when a tool call starts and/or completes, so lastProgress advances during tool-heavy turns.
  2. Distinguish embedded-run idle (no tool calls in flight) from embedded-run busy (tool call active) in the classifier, and only treat the idle case as active_work_without_progress.
  3. Document diagnostics.stuckSessionAbortMs more prominently in onboarding/upgrade notes, since the default 360s is short enough to bite users on routine long sessions on first encounter.

Environment

  • OpenClaw: 2026.5.26 (npm)
  • OS: Windows 10 (10.0.19045, x64)
  • Node: 24.14.1
  • Provider: claude-cli (Claude Opus 4.7)

Activity

  1. clawsweeper commented on May 27, 2026

    @clawsweeper
    Contributor

    Thanks for the context here. I did a careful shell check against current main, and this is already implemented.

    Current main already fixes the reported Claude CLI stall mode: Claude live tool activity now refreshes diagnostic progress during native tool chains, and the fix is in a shipped release.

    I found the merged PR that appears to have closed this: #87546: Fix Claude live tool progress for watchdog recovery.

    So I’m closing this as already implemented rather than keeping a duplicate issue open.

    Review details

    Best possible solution:

    Keep the shipped Claude live tool-progress implementation; broader non-Claude stall and session-counter reports should continue in their separate issues.

    Do we have a high-confidence way to reproduce the issue?

    No current-main failing reproduction remains. The old failure has reporter logs and the merged fix PR's before/after proof, while current source and tests show Claude live tool progress now refreshes the watchdog signal.

    Is this the best way to solve the issue?

    Yes. The shipped fix is the narrow owner-boundary repair: Claude live-session parsing feeds native tool lifecycle and heartbeat progress into existing diagnostic activity instead of weakening stuck-session recovery globally.

    Security review:

    Security review: This is an issue cleanup review with no proposed patch and no security-sensitive report.

    AGENTS.md: found and applied where relevant.

    What I checked:

    Likely related people:

    • joshavant: Authored the merged Claude live watchdog-progress repair and its regression coverage in Fix Claude live tool progress for watchdog recovery #87546. (role: introduced fix / recent area contributor; confidence: high; commits: 980a643df26b, 5b73eeb9cdcf, 4c3a0292ff9e; files: src/agents/cli-runner/claude-live-session.ts, src/agents/cli-runner.spawn.test.ts)
    • Peter Steinberger: Local history and shortlog show substantial prior work on the Claude CLI runner and CLI runner test surface, including the earlier Claude CLI JSONL streaming path. (role: historical CLI runner contributor; confidence: medium; commits: 4e099689c075, d0562a873fad, 48ae97633303; files: src/agents/cli-runner/claude-live-session.ts, src/agents/cli-runner.spawn.test.ts)
    • Vincent Koc: The shallow current-main history and latest release tag point to recent changes carrying the same Claude live and diagnostic files forward in the checkout used for this review. (role: recent current-main and release contributor; confidence: medium; commits: 40093f5a93ed, 8c802aa68351; files: src/agents/cli-runner/claude-live-session.ts, src/logging/diagnostic-run-activity.ts, src/logging/diagnostic.ts)

    Codex review notes: model internal, reasoning high; reviewed against 1db8ab373422; fix evidence: merged PR #87546, release v2026.5.28, commit 4c3a0292ff9e.

  2. WarrenJones commented on May 27, 2026

    @WarrenJones
  3. added
    P1High-priority user-facing bug, regression, or broken workflow.
    impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.
    impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.
    on Jun 15, 2026
  4. locked as resolved and limited conversation to collaborators on Jun 25, 2026
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

    P1High-priority user-facing bug, regression, or broken workflow.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions