Skip to content

fix(providers): auto-retry or recover from mid-stream connection aborts (wsarecv / connection reset) #973

Description

@euxaristia

Summary

During active streaming, transient socket interruptions such as Windows wsarecv: An established connection was aborted by the software in your host machine (WSAECONNABORTED) or read: connection reset by peer immediately abort the active turn with Run cancelled., requiring the user to manually type continue.

Context

When an established stream connection drops mid-generation before any tool calls or side effects are dispatched:

Proposed Solution

  1. Safe Mid-Stream Retry: When a stream drops before any tool execution begins, auto-retry the request with exponential backoff before failing the turn.
  2. Transient Error Classification: Classify WSAECONNABORTED, ECONNRESET, and unexpected stream EOFs as retryable transport errors when the current turn has executed no tool calls.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    issue-approvedReviewed and approved by the core team; community PRs may implement this issue.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions