Repository navigation
Extract upstream response buffering and compatibility modules - #12004
Merged
Merged
Conversation
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
lpcox
marked this pull request as ready for review
November 23, 2026 16:14
Contributor
There was a problem hiding this comment.
🔵 Needs a closer look
The extraction shifts live-response ownership and callback boundaries across fallback suppression, overflow forwarding/backpressure, and completion diagnostics, making combined lifecycle verification exceed straightforward-review scope.
No open issues 🎉
What changed in this PR
This PR addresses #11997 by splitting API proxy response handling into focused buffering and compatibility modules, while retaining orchestration and existing exports.
Changes:
- Extracts retry/fallback predicates, bounded error capture, and oversized-response forwarding.
- Centralizes JSON and streaming transform selection, preserving protocol → wire API → Codex ordering.
- Packages both modules and adds regression coverage for policy boundaries, backpressure, transforms, and Docker-layout loading.
| File | Description |
|---|---|
containers/api-proxy/upstream-response.test.js |
Adds streaming, unchanged-response, and classifier-bypass coverage. |
containers/api-proxy/upstream-response.js |
Delegates buffering and transform selection to the new modules. |
containers/api-proxy/upstream-response-transforms.test.js |
Tests transform ordering, availability, and provider selection. |
containers/api-proxy/upstream-response-transforms.js |
Centralizes JSON and streaming compatibility transform selection. |
containers/api-proxy/upstream-response-buffering.test.js |
Tests buffering policies, capture limits, and overflow backpressure. |
containers/api-proxy/upstream-response-buffering.js |
Encapsulates buffering policy, capture state, and overflow forwarding. |
containers/api-proxy/protocol-compatibility.packaging.test.js |
Checks that both modules load from the Docker COPY layout. |
containers/api-proxy/Dockerfile |
Includes both new modules in the proxy image. |
Review effort: Balanced (adaptive)
Contributor
|
✅ Copilot review passed with no inline comments. @lpcox Add the |
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.
The upstream response handler mixed fallback eligibility, error capture, and compatibility conversion in one large closure. This refactor separates those concerns while retaining response orchestration and existing exports.