Repository navigation
fix: Claude MCP turns abort before tool timeout - #155663
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed September 22, 2026, 7:13 AM ET / 11:13 UTC (Revision 2). ClawSweeper reviewWhat this changesThe PR carries Claude’s existing managed MCP tool timeout into recovery diagnostics so long-running calls are not prematurely aborted. Merge readiness✅ Ready for maintainer review The fix remains necessary on current main, and no introduced correctness or security defect was found. This member-authored, protected PR should remain open for normal landing. Priority: P2 Review scores
Verification
How this fits togetherThe CLI runner connects Claude to OpenClaw tools through a managed MCP bridge. Tool-start events feed recovery diagnostics, which decide when an inactive turn can be reclaimed. flowchart LR
A[Claude run preparation] --> B[Managed MCP timeout]
B --> C[Claude tool connection]
B --> D[Prepared run context]
C --> E[Parsed tool start]
D --> E
E --> F[Recovery deadline and grace]
F --> G[Wait or reclaim turn]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +27, Tests +85. Total +112 across 6 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep Claude’s enforced timeout and recovery allowance synchronized through the existing liveness channel while preserving independent cancellation. Do we have a high-confidence way to reproduce the issue? Yes, source establishes the mismatch: main omits the managed deadline from parsed tool-start diagnostics, permitting recovery at the ordinary 15-minute floor. The body reports a failing-before/passing-after regression; this read-only review did not execute it. Is this the best way to solve the issue? Yes. The patch supplies the missing deadline to the existing recovery owner without changing the configured tool timeout, stored settings, or cancellation path. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 6e2ac28079b1. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
Co-authored-by: VACInc <[email protected]>
Co-authored-by: VACInc <[email protected]>
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
* commit '739e2410702e0b1ad1d17a6dac07ddc0ab6dbebb': (140 commits) fix(ui): pause passive polling in hidden tabs (#155617) improve(android): keep chat photos outside text bubbles (#155338) fix(ui): preserve saved project after discovery failure (#155619) feat: compare Kitchen Sink Gateway resource costs (#155734) test(gateway): arm clock-jump claim after readiness (#155748) chore(ui): refresh control ui locales (#155700) fix(ci): join archive placement fixtures before teardown (#155751) fix(matrix): keep bot discovery off the Gateway thread (#152122) fix(agents): reconcile late requester recovery receipts (#155357) test(gateway): guard embeddings HTTP fixture lifetimes fix: isolate triage fixture acquisition and cleanup (#155736) refactor(sessions): hydrate saved transcripts off thread (#153325) fix: Claude MCP turns abort before tool timeout (#155663) fix(goals): pause terminal failures and clarify goal states (#155694) fix(test): preserve watcher errors when diagnostic capture fails (#155383) ci: move native runtime proofs to release validation (#155606) fix(auth): decouple compaction from profile rotation (#155204) fix(agents): admit compaction outside retired plugin generations (#151232) perf(ui): reduce automatic session list refetches (#155705) test: avoid unused source repos in release input fixtures (#155733) ...
* fix: keep Claude MCP turns alive through tool timeout * fix: keep managed MCP timeout ownership coherent Co-authored-by: VACInc <[email protected]> --------- Co-authored-by: VACInc <[email protected]> Co-authored-by: roboclaw-bot <[email protected]>
What Problem This Solves
Fixes: Claude CLI can report that it stopped making progress while an OpenClaw MCP tool is still within the managed connection's configured response window.
User Impact
Long-running managed MCP calls can return their result or timeout error to Claude. Explicit cancellation still interrupts the turn, and tools without the managed timeout retain the existing recovery policy.
Why This Change Was Made
The managed Claude MCP config enforces a 3,610,000 ms response timeout, but diagnostic recovery previously saw no execution deadline and applied its ordinary 900,000 ms blocked-tool floor. The prepared run now carries the same managed timeout. A trusted OpenClaw MCP tool-start event publishes that fixed deadline through the existing private liveness channel, whose recovery owner retains the normal 15-minute grace. The timeout remains owned beside Claude's generated MCP configuration; this does not change tool cancellation or the tool's own deadline.
Evidence
Behavior and tests
pnpm test src/agents/cli-runner/execute-events.mcp-recovery.test.ts --maxWorkers=1fails on pre-fixca97ceb8f9bd712205da7fef9c65eb99c5cc6f45becauseactiveToolDeadlineAtMsisundefined; on final headc9eec1f6de9e647e4ad631cd24cf176adddbe006, it passes (1 test, 12 ms test time, 29.70 s command wall). At 15 minutes, recovery observes a 4,510,000 ms threshold from tool start instead of reclaiming the turn.managedMcpToolTimeoutMs. Its exact final-head focused invocation passed (385 ms test time, 9.26 s command wall). The complete changed test file passed 184 tests in 78.19 s before the disjoint current-main refresh; the new assertion adds no test case or runtime fixture to that already broad integration-owner file.node scripts/check-changed.mjs -- <six changed paths>passed on final head, including production and test type graphs, focused lint, formatting, both max-lines ratchets, assertion safety, dead exports, dependency/config/plugin guards, and runtime import cycles.git diff --checkalso passed.Required review receipts
check-prod-typesmatched redmainand was resolved by integrating the canonical current-main declaration fix. No rerun or no-op push was used to turn a red result green.scoped-cleanwith no accepted correctness or security findings (0.86 confidence).c9eec1f6de9e647e4ad631cd24cf176adddbe006, found no correctness or security defects, and listed no “Before merge” items.Hosted checks
Exact-final-head GitHub CI passed on its first run in 1,111 seconds (11:07:28–11:25:59 UTC). The final
openclaw/ci-gate, dependency review, and security-sensitive review all reported success forc9eec1f6de9e647e4ad631cd24cf176adddbe006.What Was Not Tested
The patched code was not deployed into the live Gateway. A before/after hour-scale external call was not run because the patch only publishes the existing enforced deadline. The separate broker-side serialization delay from the observed incident is outside this PR.