fix(errors): classify connection errors as retryable failover reason#15163
Closed
fagemx wants to merge 1 commit intoopenclaw:mainfrom
Closed
fix(errors): classify connection errors as retryable failover reason#15163fagemx wants to merge 1 commit intoopenclaw:mainfrom
fagemx wants to merge 1 commit intoopenclaw:mainfrom
Conversation
360692f to
932a781
Compare
bfc1ccb to
f92900f
Compare
|
This pull request has been automatically marked as stale due to inactivity. |
|
This pull request has been automatically marked as stale due to inactivity. |
Transient APIConnectionError from the Anthropic SDK (and similar network failures) was not matched by any error pattern, so it leaked raw error text to user channels instead of being classified and retried. Add connection error patterns (ECONNREFUSED, ECONNRESET, socket hang up, fetch failed, etc.), wire into classifyFailoverReason as "timeout" (retryable), and return a friendly user-facing message. Fixes openclaw#15083 Co-Authored-By: Claude Opus 4.6 <[email protected]>
932a781 to
fc26a3f
Compare
3 tasks
Contributor
Author
|
Superseded by #43710 (rebased onto latest main with conflict resolution). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
connectionerror patterns (ECONNREFUSED,ECONNRESET,socket hang up,fetch failed,APIConnectionError, etc.) toERROR_PATTERNSisConnectionErrorMessage()intoclassifyFailoverReason()as"timeout"(retryable), so the failover mechanism can retry on a different providerTest plan
isConnectionErrorMessagetest suite (3 tests: SDK message, common patterns, negative cases)formatAssistantErrorTexttests for connection error messages (2 tests)pnpm build && pnpm checkcleanFixes #15083
lobster-biscuit
Greptile Overview
Greptile Summary
This change adds a new
connectionbucket to the agent error pattern matcher, exposes it viaisConnectionErrorMessage(), and uses it in two places:formatAssistantErrorText()now rewrites connection-related failures (e.g.,ECONNREFUSED,ECONNRESET,socket hang up,fetch failed,APIConnectionError) into a stable, user-friendly message.classifyFailoverReason()treats those connection errors as retryable transport failures by mapping them to the existing"timeout"failover reason.New Vitest suites cover both the message classifier and the formatting behavior.
Confidence Score: 5/5
Last reviewed commit: 932a781
(4/5) You can add custom instructions or style guidelines for the agent here!