Repository navigation
Refactor upstream dispatch into focused guard and transport modules - #12003
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.
🟡 Changes recommended
The workflow path filter omits both extracted modules, so changes confined to them will skip the main-branch live routing and reasoning-effort smoke tests.
1 open issue
What changed in this PR
Refactors AWF’s API-proxy upstream dispatcher into focused guard and transport modules, addressing #11996 while preserving the factory API.
Changes:
- Extracts reasoning-effort validation and enclave budget rejection into dedicated guards.
- Separates signing, credential tracking, and transport options from request orchestration and response handling.
- Adds regression coverage and updates container packaging for the new modules.
| File | Description |
|---|---|
containers/api-proxy/upstream-dispatch.test.js |
Adds regression tests for guards, signing, credential masking, cancellation, and transport options. |
containers/api-proxy/upstream-dispatch.js |
Delegates guard and transport responsibilities while retaining orchestration. |
containers/api-proxy/upstream-dispatch-transport.js |
Implements signing, credential tracking, signing-failure handling, and request options. |
containers/api-proxy/upstream-dispatch-guards.js |
Implements validation and budget rejection with existing responses and diagnostics. |
containers/api-proxy/protocol-compatibility.packaging.test.js |
Checks that both extracted modules are packaged. |
containers/api-proxy/Dockerfile |
Adds both modules to the explicit container copy list. |
Review effort: Max (adaptive)
Comment on lines
+6
to
+7
| const { rejectInvalidReasoningEffort, rejectEnclaveBudgetAttempt } = require('./upstream-dispatch-guards'); | ||
| const { signOutboundRequest, buildUpstreamRequestOptions } = require('./upstream-dispatch-transport'); |
Collaborator
Author
|
@copilot address review feedback |
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Contributor
Added both extracted modules to the model-routing workflow path filter in commit |
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.

dispatchUpstreamRequestmixed security gates, credential signing, transport setup, and response recovery in one large closure. This split narrows those responsibilities without changing the factory API.COPYlist and packaging assertions.