Repository navigation
Share enclave gateway readiness response handling - #10061
Conversation
There was a problem hiding this comment.
🔵 Needs a closer look
Security-sensitive stream-handling changes need human validation of uncovered GitHub gateway failure paths.
1 open finding
What changed in this PR
Consolidates readiness-response handling for AWF’s enclave gateways, reducing duplication on a security-sensitive path.
Changes:
- Adds shared response buffering, size-limit enforcement, and HTTP status validation.
- Integrates both gateways while retaining their error construction and retry policies.
| File | Description |
|---|---|
| src/enclave/github-gateway.ts | Uses the shared reader for GitHub gateway responses. |
| src/enclave/gateway.ts | Uses the shared reader for standard gateway responses. |
| src/enclave/gateway-readiness.ts | Implements bounded buffering and accepted-status validation. |
🧠 Review effort: Max
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| void readGatewayReadinessResponse(response, request, { | ||
| framing: () => new GithubGatewayReadinessError( | ||
| 'Shared MCP gateway response exceeded its framing bound', | ||
| ), | ||
| response: error => error, |
There was a problem hiding this comment.
Added the requested GitHub-gateway response and retry cases, including prompt rejection of interrupted bodies. Commit: 01e22cc.
|
@copilot Fix the code for all comments in this review thread. When a review comment includes a suggested change, apply the suggestion exactly. Do not make changes beyond what is described in the linked review thread. |
Addressed the linked review thread with the requested GitHub-gateway tests. Commit: |
|
⏳ Copilot review left inline comments. @copilot To proceed:
|
✅ Coverage Check PassedOverall Coverage
📁 Per-file Coverage Changes (13 files)
✨ New Files (3 files)
Coverage comparison generated by |

Both enclave gateway implementations duplicated readiness-response buffering, framing-limit enforcement, and HTTP status validation, creating drift risk on a security-critical path.
readGatewayReadinessResponse(...)for bounded buffering and accepted-status validation.