Skip to content

fix: time out stalled streams - #227

Open
victor0602 wants to merge 1 commit into
mainfrom
codex/stream-idle-timeout
Open

fix: time out stalled streams#227
victor0602 wants to merge 1 commit into
mainfrom
codex/stream-idle-timeout

Conversation

@victor0602

@victor0602 victor0602 commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator

What changed

  • Apply a timeout while waiting for streaming response headers.
  • Add a resettable idle timeout between response body chunks.
  • Abort and cancel the underlying reader when a stream stalls or its consumer cancels.
  • Allow active streams to continue beyond a single timeout interval.

Why

Streaming requests previously removed the timeout signal entirely and could hang forever when a server stopped sending data.

Impact

Stalled streams now fail predictably and release their resources, while healthy long-running streams continue normally.

Checks

  • bun test — 453 passed
  • bun run typecheck
  • bun run lint — no errors; one pre-existing test warning
  • git diff --check

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

@victor0602
victor0602 marked this pull request as ready for review August 5, 2026 12:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant