Progressively relay NDJSON/Bedrock streams, add SSE anti-buffering headers#175
Merged
Conversation
anti-buffering headers Extend the SSE progressive streaming relay to also cover application/x-ndjson (Ollama) and application/vnd.amazon.eventstream (Bedrock). Previously these were fully buffered before relay, which could trip downstream HTTP idle timeouts on slow calls. Add standard anti-buffering headers (Cache-Control: no-cache, Connection: keep-alive, X-Accel-Buffering: no) to all progressive stream relay paths, preventing reverse proxies from buffering the response. Widen onHookBypassed reason type to distinguish SSE, NDJSON, and binary stream bypasses.
Add 5 tests: NDJSON progressive timing, NDJSON content-type preservation, Bedrock binary stream progressive timing, Bedrock content-type preservation, SSE anti-buffering headers verification.
commit: |
3 tasks
jpr5
added a commit
that referenced
this pull request
May 11, 2026
## Summary Follow-up quality sweep addressing 30 issues surfaced by 7-agent CR on PR #175, complementing the broader sweep in #176. **Recorder proxy relay** — forward HTTP method instead of hardcoding POST, clear response timeout after completion, fix client-disconnect handler to check `writableFinished` before destroying upstream, wrap hook callbacks in try/catch, override audio content-type on error relay, atomic fixture writes, toolCall sanitization, tighter video detection **Server error handling** — deferred splice for one-shot error fixtures, SyntaxError guard on Azure injection catch, fixture-level chaos evaluation for non-completions endpoints, fal body double-consumption fix, fal PUT body support **Test hygiene** — tmpDir leak fix, global fetch replaced with node:http helpers, try/finally fixture cleanup, deduplicated helpers, explicit mock properties, resource guard on setup helper ## Test plan - [x] 2872 tests pass (79 files, 37 skipped) - [x] TypeScript typecheck clean - [x] Prettier + ESLint clean
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
application/x-ndjson(Ollama) andapplication/vnd.amazon.eventstream(Bedrock) — previously these were fully buffered before relay, triggering downstream HTTP idle timeouts on slow callsCache-Control: no-cache, no-transform,Connection: keep-alive,X-Accel-Buffering: no) to all progressive stream relay paths, preventing reverse proxies from buffering SSE/NDJSON/Bedrock responsesonHookBypassedreason type to distinguish SSE, NDJSON, and binary stream bypassesAddresses #172
Test plan