Repository navigation
Stop cutting Claude passthrough responses at three minutes - #40
Merged
Merged
Conversation
providerSignal applied an implicit 180-second AbortSignal.timeout to every Claude passthrough request, covering the whole streamed response. Long Claude turns, including server-side advisor calls, were aborted mid-stream: the interactive client shows "Server error mid-response", and `claude-multi -p` returns the truncated text with subtype "success". Follow the client connection instead, as the OpenAI and Zen routes already do. An explicit gateway timeoutMs still bounds every route. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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.
Problem
providerSignalgives every Claude passthrough request an implicitAbortSignal.timeout(180000), and that deadline covers the whole streamed response. The launcher never passestimeoutMs, so everyclaude-multisession gets it. Any Claude turn whose stream runs past 3 minutes is aborted mid-response:advisorModelset). Short advisor calls succeed, which made it look advisor-specific.claude-multi -p ... --output-format json, the truncated text comes back withsubtype: "success"andis_error: false. Headless automation gets a silently cut response.The OpenAI and Zen routes were already changed to follow the client connection rather than an absolute timer. Claude passthrough kept the fixed 3-minute limit.
Change
When no explicit
timeoutMsis configured, Claude passthrough follows the client connection, the same as OpenAI and Zen. An explicittimeoutMsstill bounds every route, and client disconnects still abort upstream requests. Claude Code applies its own request timeout. The unit test now asserts no implicit timer for Claude passthrough, and that an explicit limit bounds both routes. CHANGELOG has an entry under Unreleased.Validation
npm run check: 515/515 pass (Node 26.10, macOS).claude-multi -p, advisor off) through the 0.2.1 gateway:duration_api_ms180018, reported as success. Plainclaudewith the same prompt was still streaming at 487 s.duration_api_ms633140).🤖 Generated with Claude Code