Repository navigation
Split API-proxy body handling into focused modules - #11874
Merged
lpcox merged 4 commits intoNov 20, 2026
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 20, 2026 18:00
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The smoke-test workflow omits the extracted modules from its push paths, allowing main-branch changes limited to those modules to skip live model-routing checks.
1 open issue
What changed in this PR
Refactors the API proxy’s request-body handling into focused modules for #11871, keeping the existing factory interface and making transform order explicit.
Changes:
- Separates body collection, ordered transformations, and steering selection.
- Retains the factory and sleep exports and packages the new modules in the Docker image.
- Adds regression tests for body bytes, transform order, metadata, and collection lifecycle.
| File | Description |
|---|---|
containers/api-proxy/steering-injection.js |
Extracts notice selection, ranking, claims, and delivery tracking. |
containers/api-proxy/request-body-pipeline.test.js |
Tests byte preservation, transform order, and metadata. |
containers/api-proxy/request-body-pipeline.js |
Defines the fixed transform sequence and compatibility handling. |
containers/api-proxy/Dockerfile |
Includes the three extracted modules in the image. |
containers/api-proxy/body-handler.js |
Retains the factory and sleep exports while delegating implementation. |
containers/api-proxy/body-collection.test.js |
Tests size limits, stream errors, aborts, and span completion. |
containers/api-proxy/body-collection.js |
Extracts body collection and its error-handling lifecycle. |
Review effort: Max (adaptive)
Comment on lines
+11
to
+12
| const { createBodyCollector } = require('./body-collection'); | ||
| const { transformRequestBody } = require('./request-body-pipeline'); |
Collaborator
Author
|
@copilot address review feedback |
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Contributor
Added the three extracted modules to the model-routing workflow’s push paths. Commit: |
Contributor
|
✅ Copilot review passed with no inline comments. @lpcox Add the |
lpcox
deleted the
copilot/refactoring-split-containers-api-proxy-body-handle
branch
November 20, 2026 20:36
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.

createBodyHandlermixes body collection, order-sensitive request transforms, and steering selection. This refactor separates those responsibilities while preserving request bytes and caller contracts.body-collection.js: Owns the 10 MB limit, 400/413 handling, aborts, and span completion.request-body-pipeline.js: Names each transform in a fixed-order array, preserving fallback snapshots and compatibility checks before wire translation.steering-injection.js: Owns notice selection, ranking, claims, and delivery acknowledgement/release.body-handler.jsand includes all three modules in the Docker image.