Skip to content

fix(providers): classify transport errors as retriable for fallback chain#1465

Closed
darrenzeng2025 wants to merge 1 commit intosipeed:mainfrom
darrenzeng2025:fix/fallback-transport-errors-new
Closed

fix(providers): classify transport errors as retriable for fallback chain#1465
darrenzeng2025 wants to merge 1 commit intosipeed:mainfrom
darrenzeng2025:fix/fallback-transport-errors-new

Conversation

@darrenzeng2025
Copy link
Copy Markdown
Contributor

Description

Fixes fallback chain aborting on retriable OpenRouter transport resets and similar transport-level errors.

Changes

Added transport-level connection error patterns to error classifier:

  • connection reset by peer
  • connection refused
  • no route to host
  • unexpected eof
  • broken pipe
  • network is unreachable
  • connection closed
  • tls handshake errors
  • read/write tcp errors

These errors are now classified as FailoverTimeout (retriable), allowing the fallback chain to continue to the next candidate instead of aborting with "unclassified error".

Type of Change

  • Bug fix (non-breaking change which fixes an issue)

AI Code Generation

🤖 Fully AI-generated - AI wrote the code; contributor reviewed and validated it

Related Issue

Fixes #1419 (part 1 - transport error classification)

Technical Context

The issue was that ClassifyError() did not recognize common transport failures like "connection reset by peer" as retriable, causing the fallback chain to abort prematurely with:

fallback: unclassified error from openrouter/stepfun/step-3.5-flash:
failed to send request: Post \"...\": read tcp ...: read: connection reset by peer

Now these errors are classified as FailoverTimeout, which is retriable, allowing fallback to continue.

Test Environment

  • OS: Linux
  • Go version: 1.17+

Checklist

  • I have read and understood the contribution guidelines
  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • My changes generate no new warnings

…hain

Add transport-level connection error patterns to error classifier:
- connection reset by peer
- connection refused
- no route to host
- unexpected eof
- broken pipe
- network is unreachable
- connection closed
- tls handshake errors
- read/write tcp errors

These errors are now classified as FailoverTimeout (retriable), allowing
the fallback chain to continue instead of aborting on unclassified errors.

Fixes sipeed#1419 (part 1)
@sipeed-bot sipeed-bot bot added type: bug Something isn't working domain: provider go Pull requests that update go code labels Mar 13, 2026
xuwei-xy pushed a commit to xuwei-xy/picoclaw that referenced this pull request Mar 14, 2026
@sipeed-bot
Copy link
Copy Markdown

sipeed-bot bot commented Mar 28, 2026

@darrenzeng2025 Hi! This PR has had no activity for over 2 weeks, so I'm closing it for now to keep things tidy. If it's still relevant, feel free to reopen it anytime and we'll pick it back up.

@sipeed-bot sipeed-bot bot closed this Mar 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

domain: provider go Pull requests that update go code type: bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fallback chain aborts on retriable OpenRouter transport resets

1 participant