fix(claude): clear Anthropic passthrough deadline after headers - #136
Merged
lidge-jun merged 1 commit intoJul 15, 2026
Merged
Conversation
Co-Authored-By: Claude <noreply@anthropic.com>
lidge-jun
added a commit
that referenced
this pull request
Jul 15, 2026
…etch path PR #136 follow-up: extract fetchWithHeaderDeadline with a finally-guaranteed clear() so a rejected fetch no longer leaks the deadline timer. Injectable deadline factory + fetch impl give deterministic unit coverage of the success/reject/timeout paths, plus a 502 reject-path endpoint activation test.
lidge-jun
added a commit
that referenced
this pull request
Jul 15, 2026
…ning, PR #137 gui i18n, usage surface filter, routed-agent skill guard)
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.
Summary
AbortSignal.timeout()with the existingclearableDeadline()helperconnectTimeoutMsFixes #135
Problem
connectTimeoutMsis a response-header arrival budget, but the nativeAnthropic passthrough kept its timeout signal attached to the entire response
body.
As a result, a valid SSE response could be terminated after the deadline even
when its headers arrived immediately.
Test coverage
The new endpoint regression test uses a local mock Anthropic upstream:
message_startarrive immediatelyconnectTimeoutMsis 200 msmessage_stoparrives after 600 msBefore this change, reading the response body ends at the timeout and the
final event is missing. After this change, the complete SSE body arrives.
Verification
tests/claude-messages-endpoint.test.ts: 12 passedThe full Windows test run also reported three unrelated pre-existing
environment/path failures in
codex-v2-gate.test.tsanddoctor.test.ts;the Claude endpoint test file passed in full.
🤖 Generated with Claude Code