Skip to content

Bug: Infinite API socket hangs bypass fallback system #29470

Closed as not planned
Closed as not planned

Description

@niStee

Description

If an LLM provider API (like GitHub Copilot) accepts the HTTP connection but infinitely hangs without sending any data (a socket hang), no TimeoutError is thrown by the underlying fetch client. Because no error is thrown, the request remains permanently 'pending' and entirely bypasses the fallback/retry chain.

In tests, a background task sat completely stale for over 8 minutes without triggering a fallback until it was manually aborted.

Expected Behavior

The streamText execution (e.g. in src/session/llm.ts) should configure a strict idle/time-to-first-byte timeout so that infinitely hanging sockets are cleanly terminated with a TimeoutError, allowing the fallback chain to catch the failure and gracefully switch to the next model.

Related Issues

This is a sibling edge case to #29054 (which handles completed but empty text responses) and #29143, but specifically addresses hangs where the request never completes or throws a native HTTP error.

Activity

  1. github-actions commented on May 27, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    The issues #29054 (empty task output) and #29143 (infinite retry loop on provider failure) are related siblings but address different failure modes.

    If you believe this was flagged incorrectly, please let a maintainer know.

  2. niStee commented on May 27, 2026

    @niStee
    Author

    Good catch by the bot! Closing this as a duplicate of #29129.

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions