Repository navigation
Conversation
|
Codex review: needs maintainer review before merge. Reviewed October 8, 2026, 8:23 AM ET / 12:23 UTC (Revision 10). ClawSweeper reviewWhat this changesThe branch counts successfully completed embedded tools as watchdog progress under their exact current run owner, independently of later response truncation. Example: An agent completes asynchronous reads before the provider response ends with length.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR remains necessary and is ready from this review: current main retains the defect, earlier code findings are resolved, and the updated Gateway evidence satisfies the behavior-proof gap. Priority: P1 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe embedded agent executes tools while provider responses stream. Its watchdog consumes progress observations to distinguish useful work from repeated requests and decide whether to cancel a stalled run. flowchart TD
A[Streaming provider response] --> B[Embedded tool execution]
B --> C{Successful settlement?}
C -->|Yes| D[Private progress event with captured owner]
C -->|No| E[Keep stagnation evidence]
D --> F{Exact owner still current?}
F -->|Yes| G[Clear stagnation evidence]
F -->|No| E
E --> H[Existing watchdog recovery]
Technical reviewBest possible solution: Keep successful-execution accounting in the existing wrapper and progress owner, preserving failed-tool recovery and exact-generation retirement safeguards. Do we have a high-confidence way to reproduce the issue? Yes: current source establishes the omission, and the recorded real Gateway baseline demonstrates successful reads followed by false watchdog cancellation. This read-only review did not execute target code. Is this the best way to solve the issue? Yes: recording validated settlement at the existing execution boundary repairs the cause without inferring execution from response shape or increasing watchdog timeouts. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against b33494d0dfdf. Provenance checked
TestingProof path: shipped entry point. Added test files: 2. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +57, Tests +125, Docs 0. Total +182 across 8 files. View PR surface stats
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (9 earlier review cycles; latest 8 shown)
|
07fdd5e to
fdaa564
Compare
When a tool execution completes successfully under the current run owner, clear repeated-request stagnation evidence so the watchdog does not abort a run that recently did useful work. Previously, only model-call semantic results could clear stagnation, so a response truncated by max_output_tokens after successful async tool calls was treated as no progress. Error and blocked tool terminals do not clear stagnation. Stale owner events are rejected by runId comparison against the current embedded run. Fixes openclaw#166770
fdaa564 to
9c38827
Compare
|
🦞👀 Re-review progress:
|
Replace completion markers with exact owner provenance on the existing semantic-progress event. Capture before execution and validate at FIFO delivery; preserve failure and stale-owner stagnation. Drop unrelated backend changes and lint exceptions. Co-authored-by: SunnyShu0925 <[email protected]>
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
a5280bf to
bb1345e
Compare
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
@steipete Thanks for the cleanup on this one. I pushed a small follow-up on top of your head to address the outstanding proof gap from the latest ClawSweeper review (Revision 6). It's test-only (
Verified with a pre-fix fail / post-fix pass negative control (reverting the repair makes the completed case fail at A live Gateway replay wasn't run locally — the local provider can't reproduce the Responses async-tool Whenever you have a moment to take another look, that'd be great. No rush. |
|
Landing qualification for exact head The reliability campaign coordinator authorized the native inherited-failure exception for CI run 37775697435, attempt 1. The only failed jobs are the four UI shards below and their aggregate
The failed jobs all checked out merge All other executed exact-head checks passed, including lint, production/test types, Node test shards, security-fast, security review lanes, and the applicable Critical Quality lane. Skipped checks and neutral CodeQL are not claimed as passing coverage. The aggregate log attributes its failure solely to ClawSweeper revision 10 reviewed this exact head at 2026-10-08T12:23:27.124Z: Ready for maintainer review; findings: none; fix scope: complete. The PR body's negative control, 339 tests across 17 files, type checks, and real Gateway comparison remain the coordinator's accepted behavior evidence. Successful asynchronous reads survive |
|
Merged via explicitly authorized admin squash with attributed pre-existing CI failures.
|
…penclaw#166997) * fix(logging): clear watchdog stagnation on completed tool execution When a tool execution completes successfully under the current run owner, clear repeated-request stagnation evidence so the watchdog does not abort a run that recently did useful work. Previously, only model-call semantic results could clear stagnation, so a response truncated by max_output_tokens after successful async tool calls was treated as no progress. Error and blocked tool terminals do not clear stagnation. Stale owner events are rejected by runId comparison against the current embedded run. Fixes openclaw#166770 * fix(agents): count completed tools under their live watchdog owner Replace completion markers with exact owner provenance on the existing semantic-progress event. Capture before execution and validate at FIFO delivery; preserve failure and stale-owner stagnation. Drop unrelated backend changes and lint exceptions. Co-authored-by: SunnyShu0925 <[email protected]> * test(agents): use the current tool schema dependency * test(agents): align watchdog replay with production timing --------- Co-authored-by: Peter Steinberger <[email protected]> Co-authored-by: SunnyShu0925 <[email protected]>
…166997) * fix(logging): clear watchdog stagnation on completed tool execution When a tool execution completes successfully under the current run owner, clear repeated-request stagnation evidence so the watchdog does not abort a run that recently did useful work. Previously, only model-call semantic results could clear stagnation, so a response truncated by max_output_tokens after successful async tool calls was treated as no progress. Error and blocked tool terminals do not clear stagnation. Stale owner events are rejected by runId comparison against the current embedded run. Fixes #166770 * fix(agents): count completed tools under their live watchdog owner Replace completion markers with exact owner provenance on the existing semantic-progress event. Capture before execution and validate at FIFO delivery; preserve failure and stale-owner stagnation. Drop unrelated backend changes and lint exceptions. Co-authored-by: SunnyShu0925 <[email protected]> * test(agents): use the current tool schema dependency * test(agents): align watchdog replay with production timing --------- Co-authored-by: Peter Steinberger <[email protected]> Co-authored-by: SunnyShu0925 <[email protected]> (cherry picked from commit 45447ea)
…penclaw#166997) * fix(logging): clear watchdog stagnation on completed tool execution When a tool execution completes successfully under the current run owner, clear repeated-request stagnation evidence so the watchdog does not abort a run that recently did useful work. Previously, only model-call semantic results could clear stagnation, so a response truncated by max_output_tokens after successful async tool calls was treated as no progress. Error and blocked tool terminals do not clear stagnation. Stale owner events are rejected by runId comparison against the current embedded run. Fixes openclaw#166770 * fix(agents): count completed tools under their live watchdog owner Replace completion markers with exact owner provenance on the existing semantic-progress event. Capture before execution and validate at FIFO delivery; preserve failure and stale-owner stagnation. Drop unrelated backend changes and lint exceptions. Co-authored-by: SunnyShu0925 <[email protected]> * test(agents): use the current tool schema dependency * test(agents): align watchdog replay with production timing --------- Co-authored-by: Peter Steinberger <[email protected]> Co-authored-by: SunnyShu0925 <[email protected]> (cherry picked from commit 45447ea) (cherry picked from commit 6d3c7ea) Co-authored-by: RomneyDa <[email protected]>
Fixes #166770
What Problem This Solves
Fixes agent runs being aborted as
repeated_model_requests_without_progressafter successful asynchronous tools when the enclosing Responses request ends at its output limit.User Impact
Successful embedded tool execution counts as progress even when the provider later returns
length. Failed or blocked tools and completions from retired owners retain watchdog evidence. No settings, migrations, timeout increases, or protocol changes are required.Why This Change Was Made
The response classifier sees proposed calls; it cannot establish execution. The core tool wrapper already owns actual execution and terminal-result classification. It now captures the current diagnostic owner immediately before invoking the tool and publishes successful settlement through the existing private semantic-progress event. The progress owner revalidates that exact registration before emission and again at FIFO delivery, including replacements that reuse a run ID.
Removed the proposed separate settlement-marker API, unrelated CLI/ACP/worker changes, and test-file lint exception. Public and trusted-plugin completion events remain mechanical activity. Original fix by @SunnyShu0925; maintainer cleanup narrows the repair to embedded execution and the existing progress owner, preserves exact ownership, and replaces the broad diagnostic matrix with a focused execution-boundary regression. Human issue feedback from @hippoley informed the execution/provenance distinction.
Evidence
Final head:
7b34d64114d384e886d333d108307dc542119ffa. All AWS checks below run sequentially on fresh secretless leasecbx_e02e47e6a9a3(r7a.xlarge, 32,135,876 KiB RAM), runsrun_416a9484ba9132a5b96d867689b0bfdaandrun_1535e75366dfdb1623058464f9f03a42. The clean trusted-main bootstrap verified the full SHA and IAM-credentials endpoint returning 404. No hydration or Tailscale; only CI environment forwarded. Contributor source never executed on the maintainer host.expected 659000 to be undefined; four controls pass. Production restored and checked clean.--maxWorkers=1--maxWorkers=1pnpm tsgo:corepnpm tsgo:core:test --ci-graphs-json '["core-test-agents-root","core-test-infra"]'The module wall time includes the existing E2E tests’ required 348.4 s runtime build. The focused regression is import-bound: cold compiled-worker preparation took 17.992 s. It uses fake time and exercises the production execution wrapper; a classifier-only fixture would miss the execution/owner defect. In CI, its five cases took 6/2/2/2/2 ms (14 ms total), and the owning 15-file/261-test shard passed in 25.17 s.
Real Gateway proof completed, using isolated state and ports, a local mock Responses provider, and the unchanged six-minute watchdog/thirty-second heartbeat. Each scripted response admits an async read before a ten-second tail ends with
length.0043bb028914lengthterminals7b34d64114d3lengthterminalsREL6_WATCHDOG_ALL_TOOLS_COMPLETED; no stalled classification or abortSelected main recovery fields:
The error cell independently records the same abort-and-drain outcome. All three Gateway process trees were confirmed stopped; fixture error lists and cleanup error lists were empty. The successful fixed cell passed its assertions. The main command initially exited 1 on an extra assertion expecting
agent.wait.status === "error"; its actual backend cancellation and transcript evidence were already recorded. Source inspection showed that a stalled chat dispatch can hand off recovery without terminal-outcome metadata and publish a genericoksettlement. That field does not establish successful model completion. Follow-up runrun_1535e75366dfdb1623058464f9f03a42verified the saved exact-head, same-session recovery record, matching submitted run, settled receipt, absent final marker, transcript ordering, and cleanup, then passed the live error cell. Cancellation assertions use the recovery owner’s explicit abort-and-drain facts and retain the RPC status verbatim. The original submitted run is distinguished from any automatic continuation. No runtime source or watchdog timing was changed for proof.CI 37766464565 passed unit tests, production/test types, and all other executed jobs except one inherited main lint failure:
src/agents/sessions/session-manager-model-context.test.ts:72uses.sort()instead of.toSorted(). CI’s combined tree includes main83421e15378489d0ba473a3cd653592bf424b3c0; that line comes from d8c8047cab63 and is absent from this PR head. Job113276527062and the aggregate CI gate are red for that inherited error. It is now fixed on main by d1d8b113cdf9. No unrelated source change or green-only rerun was made. Local formatting, targeted lint, andgit diff --checkpass. Fresh independent Codex autoreview is scoped-clean with no actionable P0–P2 findings.ClawSweeper revision 9 reports no code findings. Earlier findings are resolved: the separate completion-marker path that lost object identity is removed; the existing emitter marks its final object. Successful execution captures the exact owner and FIFO delivery rejects a retired same-run-ID generation. The max-lines exception is removed.
The review’s main-integration concern was checked against its cited main
9c763cb168e9461f76e9c3a9059c7b38838a7d3b:git merge-tree --write-treesucceeds, producing tree0a40481f66e1b0f216fbd5a324bb76980f695c37. Main’s wrapper change (cfee851150c5) extracts skill-usage reporting after execution. Inspection of the combined wrapper confirms progress capture still occurs before execution and successful settlement before that helper. The wrapper, classifier, progress owner, and recovery files are identical between that reviewed main and the live baseline0043bb028914e6f92632623a99b482a8cd93b3b5. CI also tested the clean combined branch/main result. A final refresh against mainb925148b83b7ebddb32e1dd68769d6588d16f800also merges cleanly (treeb1f9e6a39f88079e2bfa8e4e9ae732485d7eefe8), with the relevant watchdog paths unchanged. A branch merge was unnecessary.The five owner cases prove success/error/blocked and retirement during execution/before delivery through stall classification. They use the production six-minute threshold and the issue’s 659-second stagnation, with successful work 76 seconds before classification. The existing recovery integration separately drives heartbeat/recovery, observes the active operation’s abort signal, and verifies queued work is delivered once. Same-run-ID owner replacement remains controlled owner-level proof; the provider cannot manufacture that internal registration transition. No public control or test-only production seam was added to fabricate it.
An earlier fixed-head live attempt (
a5280b, leasecbx_6b06fc9c786d) completed 43 reads and returned the marker, but its harness failed by rejecting five unrelated utility-model calls; main did not run. The source path and retry cadence matched Activity recaps. The corrected task fixture disables that optional route with the documented per-agent emptyutilityModel, retaining strict primary-provider assertions. That attempt is not counted as a passing comparison. Its lease and the earlier unit-proof leasecbx_ab2338a77315are released. Final proof leasecbx_e02e47e6a9a3is also released;crabbox list --provider awsconfirms no task-owned leases remain.Production
+82/-25(+57), tests+127/-2(+125), docs+1/-1(0); total+210/-28across eight files. The positive production delta is the work order’s LOC exception: exact owner capture, private provenance, and delivery-time validation are necessary; unrelated deletions would obscure the repair. The contributor’s follow-up classifier assertions are retained with corrected timing and narrower proof wording.Exact unit, type, and Gateway commands
The negative control retains the new tests and reverses only the five production-file changes against merge base
b9533fbd155b0d0b455b23825d9e3c32f3a1eb7a, requires the intended assertion failure, reapplies the production patch, and checksgit diff --exit-code.Timed commands use
/usr/bin/time -p. The Gateway process, native async execution, transcript store, diagnostic owner, heartbeat, and recovery remain real; only the external model provider is synthetic. All Gateway state, files, and ports are isolated from operator state.