Repository navigation
refactor(api-proxy): split wire API compatibility into focused modules - #11947
Conversation
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
There was a problem hiding this comment.
🟡 Changes recommended
Extracted translator modules are missing from smoke-test triggers and diagnostics fingerprints, allowing changes to skip live coverage and stale dependency pins to pass validation.
2 open issues
What changed in this PR
Refactors the API proxy’s Chat Completions/Responses compatibility layer into focused modules while preserving existing caller imports and exports.
Changes:
- Separates shared helpers, request translation, response/usage mapping, and streaming transforms behind the existing facade.
- Packages the extracted modules and extends integrity checks to their dependency pins.
- Adds coverage for export identity, fragmented streams, implementation drift, immutable types, and diagnostics projection.
| File | Description |
|---|---|
docs/api-proxy-sidecar.md |
Documents module boundaries and dependency pins. |
containers/api-proxy/wire-api/sse-transforms.js |
Extracts streaming translation and event framing. |
containers/api-proxy/wire-api/shared.js |
Extracts shared errors, validation, and endpoint helpers. |
containers/api-proxy/wire-api/response-translation.js |
Extracts response and usage mapping. |
containers/api-proxy/wire-api/request-translation.js |
Extracts request translation and endpoint selection. |
containers/api-proxy/wire-api-compat.test.js |
Adds facade and streaming compatibility coverage. |
containers/api-proxy/wire-api-compat.js |
Replaces the combined implementation with re-exports. |
containers/api-proxy/protocol-compatibility/index.js |
Pins the facade and extracted implementations. |
containers/api-proxy/protocol-compatibility/index.d.ts |
Declares immutable dependency pins. |
containers/api-proxy/protocol-compatibility/assessment.js |
Checks dependency integrity and refreshes the contract digest. |
containers/api-proxy/protocol-compatibility.test.js |
Verifies hashes for all pinned modules. |
containers/api-proxy/protocol-compatibility.packaging.test.js |
Verifies extracted modules are packaged. |
containers/api-proxy/protocol-compatibility-assessment.test.js |
Adds per-module drift rejection coverage. |
containers/api-proxy/model-decision-observation.test.js |
Verifies the existing strict diagnostics projection. |
containers/api-proxy/fixtures/protocol-compatibility/contract-types.ts |
Checks dependency-pin immutability. |
containers/api-proxy/Dockerfile |
Includes the new module directory in the image. |
Review effort: Max (adaptive)
| sha256: 'db7121abee27b8e453b1b7c4833fcb95c36523670d1829e7a9fb5805790bbff9', | ||
| dependencies: Object.freeze([ |
| } = require('./wire-api/shared'); | ||
| const { | ||
| translateCopilotWireApi, translateChatRequest, translateResponsesRequest, | ||
| } = require('./wire-api/request-translation'); |
|
@copilot address review feedback |
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Addressed in commit |
|
✅ Copilot review passed with no inline comments. @lpcox Add the |
Documentation PreviewDocumentation has been built for this PR. To view locally:
Built from commit 2d538c9 |
|
| Metric | Base | PR | Delta |
|---|---|---|---|
| Lines | 94.59% | 94.59% | ➡️ +0.00% |
| Statements | 93.26% | 93.25% | 📉 -0.01% |
| Functions | 93.74% | 93.74% | ➡️ +0.00% |
| Branches | 87.62% | 87.61% | 📉 -0.01% |
📁 Per-file Coverage Changes (2 files)
| File | Lines (Before → After) | Statements (Before → After) |
|---|---|---|
src/nvx/one-shot-process.ts |
84.0% → 81.5% (-2.47%) | 76.8% → 74.7% (-2.11%) |
src/commands/main-action-cleanup.ts |
96.9% → 97.9% (+1.03%) | 97.0% → 98.0% (+0.99%) |
Coverage comparison generated by scripts/ci/compare-coverage.ts
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Fixed in |
|
@copilot merge main and resolve conflicts |
…t-wire-api-compat Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Merged |
|
📡 Smoke OTel Tracing completed. All tracing scenarios validated. ✅ Smoke OTel TracingOutcome: The agent completed and reported one or more actions. The no-op output is a completion signal, not a claim that no action was taken. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
|
🛡️ Smoke Copilot Network Isolation reports failed while checking network isolation. Investigate the egress model. Smoke Copilot Network IsolationOutcome: The agent failed after emitting a no-op output. Task completion is unconfirmed; the no-op does not establish success or a transient failure. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
|
✅ Smoke Claude passed
|
|
✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟 Smoke CodexOutcome: The agent completed and reported one or more actions. The no-op output is a completion signal, not a claim that no action was taken. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
|
🔌 Smoke Services — All services reachable! ✅ Warning Threat detection engine error Threat detection could not complete its analysis due to a tooling error. This is not a security finding. What happenedThe threat detection engine failed to produce results. Review the workflow run logs to troubleshoot the error.
|
|
✅ Security Guard completed successfully! Security GuardOutcome: The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
|
✅ Smoke Copilot BYOK completed. Copilot BYOK mode operational. 🔓 Warning Threat detection engine error Threat detection could not complete its analysis due to a tooling error. This is not a security finding. What happenedThe threat detection engine failed to produce results. Review the workflow run logs to troubleshoot the error.
|
|
✅ Build Test Suite completed successfully! Warning Threat detection engine error Threat detection could not complete its analysis due to a tooling error. This is not a security finding. What happenedThe threat detection engine failed to produce results. Review the workflow run logs to troubleshoot the error. Build Test SuiteOutcome: The agent completed and reported one or more actions. The no-op output is a completion signal, not a claim that no action was taken. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose. Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
To allow these domains, add them to the network:
allowed:
- defaults
- "169.254.169.254"See Network Configuration for more information.
|
|
Smoke Cloud Hypervisor completed. Cloud Hypervisor + Copilot passed.
|
|
Chroot tests passed! Smoke Chroot - All security and functionality tests succeeded. Smoke ChrootOutcome: The agent completed and reported one or more actions. The no-op output is a completion signal, not a claim that no action was taken. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
|
📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤
|
|
Warning Threat detection engine error Threat detection could not complete its analysis due to a tooling error. This is not a security finding. What happenedThe threat detection engine failed to produce results. Review the workflow run logs to troubleshoot the error. Smoke Test: Copilot BYOK (Direct Mode) ✅ PASS
Running in direct BYOK mode via
|
Smoke Claude Results
Overall result: PASS
|
|
Cloud Hypervisor + Copilot smoke test
Overall: PASS
|
Chroot version comparison
Result:
|
OTel tracing smoke results
Filed a tracking issue for the two failures with a proposed fix.
|
Smoke Test: Copilot Engine
Overall: PASS cc @lpcox (author), assignees: @lpcox,
|
|
Merged PRs: Recompile workflows with gh-aw v1.3.1; Split Cloud Hypervisor diagnostics into focused modules
|
|
Warning Threat detection engine error Threat detection could not complete its analysis due to a tooling error. This is not a security finding. What happenedThe threat detection engine failed to produce results. Review the workflow run logs to troubleshoot the error. Services smoke test: ✅ Redis PONG · ✅ pg_isready accepting connections · ✅ SELECT 1 → 1. PASS
|
|
Warning Threat detection engine error Threat detection could not complete its analysis due to a tooling error. This is not a security finding. What happenedThe threat detection engine failed to produce results. Review the workflow run logs to troubleshoot the error. 🏗️ Build Test Suite Results
Overall: 8/8 ecosystems passed — PASS Environment workarounds (no failures in the projects themselves):
Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
To allow these domains, add them to the network:
allowed:
- defaults
- "169.254.169.254"See Network Configuration for more information.
|

The 791-line compatibility module combines request translation, response/usage mapping, and SSE state machines. This separates those concerns without changing protocol behavior or caller imports.
_testingexports.