Repository navigation
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 5, 2026, 5:03 AM ET / 09:03 UTC. ClawSweeper reviewWhat this changesThe PR makes CLI-backed agents report output and quiet deadlines to recovery, while protecting completed answers during bounded delivery finalization. Merge readiness✅ Ready for maintainer review The fix remains necessary on current main. Both prior review requests are addressed, the supplied live evidence covers the repaired path, and no new blocking defect was found. Priority: P1 Review scores
Verification
How this fits togetherOpenClaw’s recovery watchdog uses runtime activity to decide when to cancel stalled agent turns. CLI execution supplies that activity, and the reply lifecycle owns delivery and final cleanup. flowchart TD
A[Incoming agent turn] --> B[CLI lifecycle owner]
B --> C[Backend execution and output]
C --> D[Owned activity and quiet deadline]
D --> E[Recovery watchdog]
E --> F[Continue healthy work or cancel stalled work]
C --> G[Committed answer]
G --> H[Bounded delivery finalization]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +254, Tests +769. Total +1023 across 29 files. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Technical reviewBest possible solution: Keep one lifecycle-owned recovery path that respects existing backend limits and delivery leases without adding another registry or operator setting. Do we have a high-confidence way to reproduce the issue? Yes: current main exposes the missing CLI progress publication, and the supplied baseline run shows recovery interrupting continuing output. This review did not execute a new current-main reproduction. Is this the best way to solve the issue? Yes: the patch repairs missing facts at the executing owner and reuses existing recovery and finalization machinery. A global timeout increase or session-key deadline table would leave ownership and cleanup races unresolved. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 723731b5f7ad. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (4 earlier review cycles)
|
A CLI-backed agent turn that ran longer than ~6 minutes could be killed by stuck-session recovery while it was still streaming, and its completed reply was then never delivered to the channel. Three producer-side gaps, all in how liveness facts reach the watchdog: - The CLI backend counted stdout bytes for its own no-output watchdog but never published them as diagnostic run progress, so the freshness clock only advanced at tool boundaries. The core runtime already publishes per-chunk stream progress; the two implementations are now one shared reporter, and every CLI backend publishes through it. - The CLI backend never published its resolved no-output deadline, so the generic 360s model-call floor preempted a backend allowance the operator had already configured. That deadline now rides `model.call.started` as `requestTimeoutMs` and bounds the generic floor, matching the direct provider path. - Stale-expiry recovery ignored the `freezeAbort()` completion-wins seam that `supersede()` honors, so it could abort a turn whose terminal outcome was already committed and only delivery remained. Recovery now reports `keep_lane / terminal_outcome_committed` and leaves that owner to the existing finalization lease. No new configuration surface: `agents.defaults.timeoutSeconds` and the backend's `reliability.watchdog` settings now govern this path. Claude-Session: https://claude.ai/code/session_0122p4qSQzsjwFgYUCDNrwMK
…he turn Stdout keeps flowing on the CLI protocol stream while a parsed tool is open. Publishing that as model-stream progress would refresh the same clock blocked-tool recovery reads, so a wedged tool could never age into its 15-minute window. Mirror the core sibling, where stream progress is only observed on model response chunks: skip the progress mark while a parsed tool owns the turn. Claude-Session: https://claude.ai/code/session_0122p4qSQzsjwFgYUCDNrwMK
The deadline test drove markDiagnosticModelStartedForTest, which passes coreRequestForTest and bypasses the active-owner gate that ordinary starts hit, so it proved nothing about the production path. Drive the real trusted event instead, and pin the companion case where an owner-bound attempt holds the same session activity and an ownerless deadline is dropped. Claude-Session: https://claude.ai/code/session_0122p4qSQzsjwFgYUCDNrwMK
The no-output deadline rode claude-cli's model-call diagnostics, and that factory returns for every other backend id, so a supported non-Claude CLI backend published no allowance and its configured quiet window could still be preempted by the generic 360s recovery floor. Carry the deadline on the stream-progress update every CLI backend already reports, record it on the session activity, and let both the embedded-run and model-call recovery predicates extend their floor to it. This replaces the claude-cli-only requestTimeoutMs field on model.call.started, so the ownerless start gate no longer gates the allowance either. Claude-Session: https://claude.ai/code/session_01VhcCrpA9PB6VWSWAkFoLgY
The deadline reaches recovery through the shared stream path rather than the Claude-only model-call diagnostics, so pin that at the execution boundary with a backend whose diagnostics helper never arms. Claude-Session: https://claude.ai/code/session_01VhcCrpA9PB6VWSWAkFoLgY
The new CLI diagnostics cases enabled diagnostics process-wide, started run activity tracking, then forced both off at teardown without draining the event queue. The agents-support lane runs `--isolate=false`, so those globals and the listener leaked into every later file in the same worker. Restore the prior enabled value, drain queued events, and reset the event state before handing the worker on. Claude-Session: https://claude.ai/code/session_01VhcCrpA9PB6VWSWAkFoLgY
2947218 to
1f90915
Compare
…s output The allowance rode the stream-progress update, so it only reached recovery once stdout arrived. A backend permitted to stay quiet for longer than the generic 360s floor could still be reclaimed before its first chunk - exactly the window the allowance exists to cover. Give the deadline its own owner, declared as the child starts and released when that child settles, and read it in the recovery predicates. This also drops the allowance off the run-activity record, so it no longer rides the progress clock or depends on the ownerless model-call start being admitted. Claude-Session: https://claude.ai/code/session_01VhcCrpA9PB6VWSWAkFoLgY
|
@clawsweeper re-review Head: Both prior rank-up moves are addressed. Backend allowances now belong to the exact live owner, and the overlapping same-session The updated PR body includes independent real Telegram red/green, silent-call expiry, cancellation/replacement, accepted-send finalization and native tool-path evidence. It also states the limits of the declined idle-timer probes. Exact-head CI and the independent landing review are running. |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Thanks @anandnsharma and @anand-thepasselgroup! Landed in f5fce6e59e45dea4d559405814ba346044efecc7 from reviewed head ff1b4ffd578370bcf10170f6f6f7d319dd34422d. Exact-head CI passed, and the final native independent review reported no findings. Proof: A real Telegram user turn through the native CLI kept producing text beyond the unchanged 360-second recovery threshold and delivered its full answer. Silent-call expiry, cancellation/replacement, accepted-send finalization and the native tool path also passed.
514 focused and sibling tests passed. The explicit overlapping-call regression failed with the baseline producer, then passed with the repair. The long-idle tool probes were declined and are not counted as passes; deterministic owner tests cover the separate tool timing policy. This preserves the original work from #137372. The distinct direct-provider issue #137263 remains outside this repair. |
Publish real CLI stream progress and the backend's existing quiet allowance through the exact current diagnostic owner. Release only the settling attempt, reject stale observations after closure or replacement, and keep active-tool recovery independent. Preserve committed replies under the existing bounded finalization lease. Remove the separate session-ref deadline store and share the model stream-progress reporter. Continue the contributor work from openclaw#137372. This does not claim to fix the distinct direct-provider issue openclaw#137263. Co-authored-by: Anand Sharma <[email protected]> Co-authored-by: Ayaan Zaidi <[email protected]>
Continues #137372 on the original contributor branch. Thanks @anandnsharma and @anand-thepasselgroup for the report, implementation and prior proof. The maintainer repair and validation are AI-assisted.
What Problem This Solves
Healthy CLI-backed turns can keep producing output while generic stuck-session recovery treats them as silent. Recovery can then abort the turn before its answer reaches the chat channel.
The independent Telegram reproduction showed real text arriving only 245 ms before recovery interrupted the turn at 387 seconds. The normal recovery threshold was 360 seconds; the CLI backend's existing quiet allowance was 600 seconds.
Why This Change Was Made
The CLI producer did not keep the existing recovery owner informed of its output and allowance. The submitted session-ref deadline table also let one finishing call erase another call's allowance.
The repair keeps those facts with the exact existing lifecycle owner:
serialize:falsecalls.The separate session-ref deadline store is removed. Existing session index and merge logic is moved into its state module; it is not a second store. No global timeout, configuration option, schema, protocol or privileged plugin grant is added.
User Impact
Long, healthy CLI-backed turns keep their answers and deliver them to the channel. Genuinely silent calls still expire. Cancellation, replacement and finalization keep their existing owners.
This does not claim to address the distinct direct-provider problem in #137263 or the separate quiet-background-task work.
Production: +754/-500, net +254. Tests/support: +1921/-1152, net +769, including suite moves. The production growth supplies exact-owner observation and revocation plus committed-finalization protection. A global timeout increase or a session-only table cannot provide those guarantees.
Evidence
Real Telegram and native CLI
Telegram Test Server user DM → isolated built Gateway → real Claude CLI, using
claude-opus-4-6.407a8f453c0f0306af1ddc0aafa8697c1d49a9e719d741520877d87d4432f736c7821c16dc6bf2a5/stopaborted the active turn; the replacement request replied normally.node --version; the matching tool result wasv24.20.0, and Telegram received it.The full prompt fits the observed 200,000-token context and 64,000-token output limit. No fake provider output, shortened recovery watchdog or source-import probe was used as live red/green evidence.
The final head
ff1b4ffd578370bcf10170f6f6f7d319dd34422dadds only the explicit overlap test after the integrated runtime. Production, dependencies, build inputs and live scenario inputs are unchanged. The actual19d7415package and its original stamps are retained; it is not relabeled as a build of the test-only commit.Focused validation
514 distinct tests across 22 files passed. The new overlap case failed with the baseline producer's missing allowance, then all 75 tests in its file passed with the repair. Its ordering verifies that the first call's completion and owner closure preserve the second call's allowance.
The two-file rerun covers the initial fixture-reaping failures; the final single-file run covers the added overlap case. The canonical
node scripts/run-tsgo-core-test-shards.mjs --changed-paths-json "$review_paths_json"selection, using the complete final PR changed-path list, passed all 16 core-test graphs. Formatting, scoped lint and the retained selected guards passed. Process-tree tests ran with a standard child reaper; the initial failures and corrected fixture runs remain in the evidence.Review disposition and limits
serialize:falseregression is present.