Repository navigation
fix(provider-runtime): retry transient socket failures - #122535
Conversation
Punchcard-Session: golden-cedar-brook-4q
Punchcard-Session: golden-cedar-brook-4q
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Codex review: needs maintainer review before merge. Reviewed August 12, 2026, 4:11 AM ET / 08:11 UTC. ClawSweeper reviewWhat this changesThe PR adds Undici’s Regression provenancePossible regression — probable (reviewed change; failure trace). No predecessor PR is attributed. Merge readinessKeep this active maintainer PR open for normal review. The shared narrow retry matcher currently omits a code that the broader network policy, Plugin SDK classification, and linked provider report already treat as transient; the patch fixes that mismatch at the common owner without changing retry limits or create-operation behavior. Priority: P1 Review scores
Verification
How this fits togetherProvider reads and agent-run waits use a shared network-error classifier to decide whether a transient transport failure should be retried. A positive classification continues the bounded recovery path; a negative one surfaces the failure or triggers provider fallback/cooldown. flowchart LR
A[Provider read or agent wait error] --> B[Shared connection-error matcher]
B --> C{Transient code?}
C -->|yes| D[Existing bounded recovery]
C -->|no| E[Surface failure]
D --> F[Continue agent work]
E --> G[Fallback or agent error]
Before merge
Agent review detailsSecurityNone. PR surfaceSource 0, Tests +2. Total +2 across 3 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: Merge the focused common-matcher update with its two consumer-level regression cases, preserving the existing bounded retry policy and fail-fast create operations. Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible: current main omits Is this the best way to solve the issue? Yes. Updating the shared narrow matcher is the best fix because it repairs both established consumers without widening individual caller policies, retry counts, or create-operation behavior. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 716f996be8db. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
* test: cover UND_ERR_SOCKET retry recovery Punchcard-Session: golden-cedar-brook-4q * fix(provider-runtime): retry UND_ERR_SOCKET failures Punchcard-Session: golden-cedar-brook-4q
Fixes #91675
Additional instructions
MUST: Keep Allow edits from maintainers enabled for this PR so maintainers
can help update the branch when needed.
What Problem This Solves
Fixes an issue where provider reads and recoverable gateway waits would fail immediately when Undici reported a transient socket failure as
UND_ERR_SOCKET.Why This Change Was Made
The shared connection-error matcher now recognizes Undici's socket error code, so existing bounded provider-read retries and gateway-wait recovery use the same classification. This does not add provider-specific logic, change retry counts, replay creates, or alter config, environment, dispatcher, guarded transport, or fallback behavior.
User Impact
Users are less likely to lose an agent turn or enter provider fallback/cooldown after a transient Undici socket close. Non-retryable failures and create operations remain fail-fast.
Production LOC: +1/-1 (net 0) | Tests: +2/-0
Evidence
cause.code = "UND_ERR_SOCKET"provider case and shared gateway-wait recovery case both failed.node scripts/run-vitest.mjs src/provider-runtime/operation-retry.test.ts src/agents/run-wait.test.ts- 70 passed.oxfmt --checkandgit diff --checkpassed.tbx_01kzte7np01v8v7cvbjhmenpvzran the focused tests and fullpnpm check:changedsuccessfully on exact headbb16d2ec0d76485cebbe9a1ad0a09eb66641d4c0: https://github.com/openclaw/openclaw/actions/runs/31574465715nothing_found, high confidence; best fix confirmed at the shared matcher owner.No changelog entry: this is a narrow regression repair with no new public surface.
Punchcard-Session: golden-cedar-brook-4q