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 9, 2026, 8:07 AM ET / 12:07 UTC (Revision 4). ClawSweeper reviewWhat this changesRecover final answers after an exact terminated-stream error by retaining completed tool results and preserving lifecycle notifications through the existing tool-free finalizer. Merge readiness✅ Ready for maintainer review This remains a useful, focused fix: current main still misses the reported recovery path. No blocking patch defect was found, and the supplied real-transport and Gateway observations satisfy the behavior-proof requirement. Priority: P2 Review scores
Verification
How this fits togetherThe embedded agent runner turns provider responses and completed tool results into an assistant reply. Its finalizer can recover a missing answer without repeating tools, while the outer execution owner publishes the run’s final outcome. flowchart TD
A[Provider stream and tool results] --> B[Attempt result projection]
B --> C{Tools settled and recovery eligible?}
C -->|Yes| D[Tool-free finalizer]
C -->|No| E[Preserve existing outcome]
D --> F[Final answer and lifecycle notification]
F --> G[Outer owner publishes completion]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +13, Tests +73. Total +86 across 7 files. View PR surface stats
Review metricsNone. 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 recovery in the existing context producer and tool-free finalizer, preserving completed effects and caller-owned terminal publication. Do we have a high-confidence way to reproduce the issue? Yes: current source excludes bare terminated without a recognized transport code from recovery context, and the supplied before/after transport and late-cut Gateway observations exercise that gap. This read-only review did not execute the reproduction. Is this the best way to solve the issue? Yes: repairing the context producer and forwarding existing lifecycle fields reuses the established recovery mechanism without weakening terminal-error guards or adding another retry policy. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 87ade599b623. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (3 earlier review cycles)
|
…h "terminated" A bare `terminated` transport failure on the final post-tool provider call carries no retryable code, so the settled-turn finalization context producer treated it as non-transient and the whole run failed as "LLM request timed out" even though no run timeout had fired and all tool work had settled. Reuse the failover timeout family anchored `^terminated$` pattern in the transient predicate so the existing tool-free finalization path recovers the final visible reply. Fixes openclaw#142149
d5df610 to
4512562
Compare
|
Added the missing real-behavior proof for the exact bare What it proves (real transport, no fixtures for the failure itself):
Evidence after fix: Evidence before fix (same test with only the fix files reverted to main — the already-recognized HTTP/WebSocket cases still pass, the bare The PR body Evidence section has been updated accordingly. Note on the earlier red checks at d5df610: |
Reuse the existing exact transport-message pattern when capturing settled-turn context. Preserve ordinary transcript continuation, timeout classification, and the tool-free finalizer safeguards.
Forward the existing caller lifecycle callback and deferral setting into built-in finalization so the recovered turn replaces its prior attempt error and the outer caller publishes its final outcome.
|
landpr-approve-unrelated-red |
|
Thanks @LiuwqGit! Landed as 5614557 with your authorship preserved. Proof: The real Gateway baseline lost the final reply after a completed write and an interrupted HTTP response once the ordinary retry window had elapsed. The repaired run uses the existing tool-free finalizer, stores one answer, preserves the original messages, and completes successfully without repeating the write. Independent native acceptance confirmed both that recovery and the unchanged ordinary-continuation path. Focused checks and the exact-head security-aware review passed. CI disposition: Run 34347762454 completed with 139 successful jobs, 17 skipped jobs, and one failed child plus its aggregate. The failed child reports a Telegram loopback model-confirmation Scope: Existing asynchronous-work, unfinished-tool, cancellation, refusal, delivery and timeout safeguards remain. The proof uses a loopback provider; it does not certify the original Windows/background-download scenario. #142149 remains open for that broader reproduction. |
AI-assisted: yes
Related: #142149
What Problem This Solves
Fixes an issue where a completed tool-driven turn loses its final reply when the provider stream ends with bare
terminatedafter the ordinary retry window has elapsed. The turn reportsLLM request timed outeven though its run timeout did not fire.Why This Change Was Made
Reuse the existing anchored transport-message pattern when capturing settled-turn context. Preserve the caller's lifecycle callback and terminal deferral through the built-in finalizer, so the recovered answer ends the run successfully instead of retaining the prior attempt's error.
The normal transcript-continuation path, timeout-family classification, exact tool-settlement checks, cancellation, refusal and permanent-error guards remain unchanged. The finalizer still has no callable tools.
User Impact
Eligible completed turns retain their final summary without repeating tool effects. Asynchronous or unfinished work, previously visible answers and unsettled delivery remain excluded.
Evidence
The real authenticated Gateway proof uses
chat.sendandagent.wait, the built-in file tool, an actual interrupted HTTP response body and the built-in finalizer. An initial transient failure starts the existing retry window; the later post-tool stream closes after that window expires. The fixture does not disable retries or change timeout policy.82d4e9a: one completed write, persistedterminated, no final answer, and the existing timeout-family error.Candidate
96d2cfe4passes the real late-cut Gateway flow: the existing finalizer sends one request with no callable tools,agent.waitreturns success, history contains one final answer, the original message prefix is unchanged, and the only added message is the final answer. Normal cache bookkeeping remains separate from messages. The completed write is not repeated.Fresh source-blind native acceptance independently passed both the late-cut recovery and ordinary-continuation controls on
96d2cfe4. The full negative-state and source-mechanism gates are covered separately by focused tests and source review. Exact-head hosted CI and the final review gate remain required before landing.Limits: the provider is a deterministic loopback service. This does not certify a live Windows llama.cpp/llama-swap deployment or make every background-download run eligible. Private internal flags/context are supported by source and observed lifecycle evidence, not claimed as directly exported fields.