Repository navigation
fix(agents): recover tasks when Responses streams end mid-tool-call - #144583
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 11, 2026, 11:14 AM ET / 15:14 UTC (Revision 2). ClawSweeper reviewWhat this changesRecognizes Responses streams interrupted during tool calls as recoverable failures, with documentation and regression coverage for preserving completed work. Merge readiness✅ Ready for maintainer review The refreshed review finds no blocking defects at the unchanged head. The recovery gap remains on current main, so this protected maintainer PR remains useful. Priority: P2 Review scores
Verification
How this fits togetherOpenClaw’s Responses transport turns streamed model events into assistant messages and tool calls. The shared failure classifier determines whether the agent continues its existing transcript or reports a terminal failure. flowchart TD
A[Responses stream] --> B[Stream parser]
B --> C[Completed tool calls]
B --> D[Premature stream end]
D --> E[Shared failure classifier]
E --> F[Bounded transcript recovery]
C --> F
F --> G[Answer or terminal failure]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +17, Tests +115, Docs +2. Total +134 across 7 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep premature EOF recognition in the shared classifier so existing bounded recovery preserves settled work while terminal tool-validation failures remain excluded. Do we have a high-confidence way to reproduce the issue? Yes, source establishes a deterministic path: end the Responses event sequence with an active tool call and no terminal event; current main emits an error that its recovery matcher misses. No runtime reproduction was executed in this review. Is this the best way to solve the issue? Yes. Extending the existing shared matcher is a narrow repair that reaches both retry and finalization consumers without changing transport admission or adding another recovery policy. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against af73c58582b5. LabelsLabel 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)
|
|
@clawsweeper re-review The native merge guard requires a fresh review because the previous review expired overnight. The head remains bc09908; exact-head CI and native preparation have passed, and no code changed after the previous clean review. |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Merged via squash.
|
What Problem This Solves
Fixes an issue where users running agent tasks would see a generic "Agent run failed" error when an OpenAI Responses stream ended while a tool call was still unfinished, even though the task could continue from its saved transcript.
Why This Change Was Made
Recognize the transport's exact premature-end error in the shared incomplete-stream matcher, so existing transient continuation and settled-result finalization can handle it. Completed responses with inconsistent tool calls remain excluded; partial tool arguments are never admitted for execution.
User Impact
Tasks can recover from this interrupted stream without resubmitting the original request or automatically repeating completed tool actions. The existing retry budget and cancellation rules continue to apply.
Evidence