Repository navigation
refactor: simplify model retry recovery decisions - #151995
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 18, 2026, 2:07 PM ET / 18:07 UTC (Revision 3). ClawSweeper reviewWhat this changesConsolidates model retry classification, continuation checks, and attempt-state updates while removing redundant comments and an unnecessary type assertion. Merge readiness✅ Ready for maintainer review Keep open as a useful, maintainer-requested cleanup. The pinned patch preserves retry behavior, has passing exact-head CI, and introduces no actionable findings; current main does not contain the cleanup. Priority: P3 Review scores
Verification
How this fits togetherOpenClaw's embedded agent runner consumes model responses and tool-completion evidence to decide whether to continue the transcript, retry, or finish. Its recovery checks preserve completed work and enforce cancellation and retry limits. flowchart TD
A[Model response or failure] --> C[Retry classification]
B[Tool completion evidence] --> D[Continuation safety checks]
C --> D
D --> E[Retry budget and cancellation]
E --> F[Continue existing transcript]
E --> G[Finish or consider fallback]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource -42, Other 0. Total -42 across 10 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep retry decisions with their existing owners and retain the current recovery safeguards without adding configuration or parallel policy. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR proposes behavior-preserving cleanup rather than a new bug fix; source inspection found equivalent decisions and existing regression coverage. Is this the best way to solve the issue? Yes. Deriving retry evidence inside its owner and sharing identical predicates removes duplication without introducing another recovery path. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against cfc9723a15fc. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
|
Merged via squash.
|
Related: #151610
What Problem This Solves
Simplifies the model retry code after the recovery-window fix, removing duplicated decisions and stale explanations that make retry ownership harder to review.
User Impact
No user-visible behavior change. Retry budgets, provider wait floors, cancellation, transcript continuation, auth rotation, and native-harness retry policies remain unchanged. No configuration or migration is required.
Why This Change Was Made
The retry classifier now derives transient evidence from its own input instead of accepting a separately computed boolean. Embedded recovery shares repeated tool-continuation predicates and completed-response selection; the run loop records normalized state once for both retry and proceed paths. Removes an unnecessary cast and stale comments, with an exact shrink of its assertion baseline. Net reduction: 42 lines across nine source files and one baseline entry.
This is the maintainer-requested cleanup following #151610. The broader audit separately reproduced text retry-hint parsing gaps and Bedrock's default SDK retry envelope; those functional findings are outside this behavior-preserving PR.
Evidence
All 1,474 selected tests passed across eight files covering classification, recovery, retry budgets, incomplete turns, and model-response completion. The complete changed-file gate passed, including production/test typechecking, lint, formatting, dead-export scans, and architecture guards. Independent review through P2 found no actionable defect in the cleanup. Exact-head CI run 35374858305 passed, including
openclaw/ci-gate. ClawSweeper also reviewed the exact head with no actionable findings. No live Gateway was modified or deployed.