Repository navigation
fix: name pending tools when the reply watchdog stops a run - #200601
Merged
Merged
Conversation
Contributor
|
🦞👀 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. |
Contributor
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Contributor
Author
|
Merged via explicitly authorized admin squash with attributed pre-existing CI failures.
|
This was referenced Nov 17, 2026
This was referenced Nov 17, 2026
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Nov 18, 2026
…#200601) * fix: name pending tools when the reply watchdog stops a run * docs: explain worker catalog execution context
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related: #138528
Related: #191637
What Problem This Solves
A reply stopped by the watchdog reports “Reply operation stalled” without identifying the tool it was waiting for. After abort cleanup, those pending-tool records are gone, so operators cannot recover that attribution from the lane error or automation history.
User Impact
The existing lane-error record now includes
staleReasonand up to fivependingTools, each containing onlytoolName,toolCallId, and elapsed milliseconds at the stop. Automation history includes the same identities alongside its recovery classification. Provider rate-limit text and the semantic classification used for alert guidance keep their existing precedence.Why This Change Was Made
The session-controller watchdog already owns the tool names, call IDs and start times.
describeStop()(src/sessions/session-controller.watchdog.ts:438) discarded them when building its abort error.abortForStall()(src/sessions/session-controller.operation.ts:650) already calls it before cleanup, so the fix captures those existing records there, without changing abort ordering or keeping another tracker.The worker path had a second gap: its tool-surface setup (
src/worker/embedded-agent.runtime.ts:317) used the catalog's default executor, which does not publish nested host-call lifecycle events. The worker's live-event owner now adapts catalog start/end events using the existing schema'snameandtoolCallId; required argument/result slots arenull, so this attribution adds no tool content. The Gateway's existingworker-turn-run-owner.ts:232projection registers the host tool under its own name.This extends #191637's controller-to-history projection. #138528 remains open: immediate exec-denial classification and the broader approval failure are outside this fix. Correlating the host call with a Code Mode
bridgeRequestIdstill needs an approved protocol field; no schema, timeout, threshold, config or bridge-correlation change is included here.Evidence
The controller regression queues a run with six pending tool calls that never finish normally, advances the watchdog to its stop, and checks the abort classification and existing lane diagnostic after cleanup. Only the first five tools survive, each with
elapsedMs: 900000.On base
176f2ff9652ea6539192a7c580940ced94b27942,pnpm test src/sessions/session-controller.watchdog.test.ts --maxWorkers=1failed as intended: 1 failed / 64 passed;pendingToolsandstaleReasonwere absent. The fixed regression is green. Code Mode coverage verifies the named host record with Node and QuickJS, the worker catalog-to-live-event adapter, the Gateway receiver, and cron history while retaining the semantic alert cause. These are focused production-owner boundary tests with synthetic tools, not a credentialed model or deployed-worker campaign.All focused checks passed: 160 tests across six files; core production typecheck and a targeted six-file test typecheck; production/test type-aware lint; formatting;
git diff --check; andpnpm build(final run: 2m 26.7s). The build returned zero; its UI bundle-budget advisory listed overages, with no UI source changes in this PR. A separate baseline budget measurement was not run.Per-file local timing: watchdog owner 65 tests / 56.48s wrapper wall; worker live runtime 18 / 44.74s; Code Mode lifecycle 22 / 18.75s shard wall; cron cause 10 / 9.00s; Gateway worker ownership 15 / 63.63s; command queue 30 / 3.64s. The two new regression cases' single-file runs spend 95–96% of their Vitest duration preparing compiled subprocess artifacts; their test bodies remain below one second. The existing Gateway suite uses real worker/store lifecycle boundaries. The final CI job span was 955s (15m 55s), with results qualified below.
Codex autoreview of the complete local change against
176f2ff9652ea6539192a7c580940ced94b27942, through P2:scoped-clean, no accepted/actionable findings. The reviewer received the unchanged abort operation, recovery owner, and worker receiver as context; it did not independently rerun tests or inspect the unchanged catalog executor contract. The catalog's default execution/acceptance path was separately traced in source and exercised by the focused worker guest regression.Net test growth: 146 lines, below the 400-line allocation threshold. The production growth is the typed abort error/projection and the worker's missing lifecycle adapter; no parallel state store or tool tracker is added.
docs/logging.mddocuments the diagnostic shape. Release-note context: watchdog abort diagnostics and automation history now name pending tools, including Code Mode host calls on worker turns.CI Follow-through
The first run, 44091557036, found an assertion-safety documentation gap in the new worker adapter. The worker constructs four-argument host tools, while the shared catalog executor also accepts extension tools with a fifth context argument. A
SAFETYcomment now explains that existing boundary. The focused assertion-safety ratchet, worker type-aware lint, formatting, and a Codex review of the comment-only repair all pass; no runtime behavior changed.That run also failed
src/gateway/server.sessions.create.forks.test.ts > sessions.create inherits only durable selection: explicit selection: expected absenttotalTokens, received0. The focused commandpnpm test src/gateway/server.sessions.create.forks.test.ts --maxWorkers=1 -- -t 'sessions\.create inherits only durable selection: explicit selection'reproduces the identical failure both on the PR and on unchanged base176f2ff9652ea6539192a7c580940ced94b27942(one failed, 23 skipped in each). The test and creation owners are unchanged by this PR;src/gateway/session-create-initial-assistant.ts:112initializes fresh-sessiontotalTokensto zero. This is pre-existing evidence, not a passing replay or a fix to session creation.Final head
e75676862b09b027b1de87982c7b96b016524ddecompleted 44094575933, attempt 1: 81 terminal jobs, 50 successful, 27 skipped, and four failed (three roots plus their aggregate gate).security-fastand baseline ratchets passed. The job span was 955s.The three unrelated root failures are independently attributed for the native landing exception:
totalTokensfailure reproduced on base above.CI tested merge
448c2de94157185822b585a92310f574086b77c9, whose ordered parents are main6e38d6dc714da46ab482a0d6fe6889521ee22644and this exact PR head. The build admission sources, CI workflow, failing session-creation test, and creation owners have identical Git objects between that main parent and the tested merge. The aggregate gate reports those three roots. Native exception evidence retains the failed attempt, source-object comparison, checkout, logs, and passing scoped proof; CI is not described as green.