Repository navigation
Conversation
Discovery metadata fetches, remote endpoint probes, dynamic registration, and the provider token exchange now share one transport that resolves the destination once and connects only to that address.
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Executive SummaryThe incremental changes resolve both previous findings: the abort listener is now removed on request close, and the new test plus mock Files Reviewed (3 files)
Previous Review Summaries (2 snapshots, latest commit d746956)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit d746956)Status: 2 Issues Found | Recommendation: Address before merge Executive SummaryThe previous timeout and compression findings are fixed; the remaining gaps are the never-removed abort listener on the caller signal and an abort test that never exercises the mid-flight abort path. Overview
Issue Details (click to expand)SUGGESTION
Files Reviewed (3 files)
Fix these issues in Kilo Cloud Previous review (commit 743f2e2)Status: 2 Issues Found | Recommendation: Address before merge Executive SummaryThe pinned outbound transport correctly closes the DNS-rebinding gap, but it drops the implicit timeout that Overview
Issue Details (click to expand)WARNING
SUGGESTION
Notes
Files Reviewed (10 files)
Reviewed by deepseek-v4.1-flash · Input: 39.9K · Output: 6.4K · Cached: 295.9K Review guidance: REVIEW.md from base branch |
…nses The shared transport applies a socket timeout, honors an abort signal, advertises supported encodings, and decodes gzip, deflate, and brotli bodies before the response is built.
The transport drops its abort listener when the request settles, and the unit tests exercise an abort while the response is outstanding.
|
bot: The whole MCP Gateway feature was removed from
Every path this branch changes was deleted by #8156, so the conflict is modify/delete on all of them and can only resolve to an empty diff. Closing without merging: there is nothing left on |
Pull request was closed
Change
Adds one outbound transport for MCP gateway provider traffic (
apps/web/src/lib/mcp-gateway/outbound.ts). It resolves the destination in the same call that opens the connection and binds the socket to that address through a customlookup, while keeping the original hostname for theHostheader and SNI. Each request is bounded by a 30s socket timeout, honorsinit.signal, and advertises and decodes gzip, deflate, and brotli response bodies before theResponseis returned.Routed through it:
fetchJson, challenge metadata, authorization-server candidates)discoverRemoteProviderregisterDynamicProviderClientandcreateDynamicProviderCredentialshandleProviderCallbackvalidatePublicHttpsDestinationstays for the early checks that are not followed by a request: config creation (includingauthMode: none) and stored provider endpoints. The injection option is renamedfetchImpl->requestImpl; production constructs the services without it, so every real request uses the bound transport.Verification
NODE_ENV=test pnpm jest src/lib/mcp-gateway --runInBand— 6 suites, 49 tests pass, including new unit tests that show each request connects to the address resolved for it, a compressed response decoded back to JSON, and an abort while the response is outstanding.pnpm --filter web run typecheck— passes.pnpm --filter web run lint— 0 errors.https://example.com/fetched through the transport returns 200 with TLS and Host preserved;http://is rejected;createDiscoveryService().discoverRemoteProvider('https://example.com/')completes over the transport;https://httpbin.org/gzipreturns parsed JSON with thecontent-encodingheader removed.Proxy answers
The owner's proxy gave these answers in the owner's place.
Answer: node:https request with pinned lookup (Recommended)
Confidence: 0.60 · Precedent: Speed and least work: "do the least amount of work possible, with no drop in quality" (7f3470e0ba6f). Engineering conventions: prefer existing code paths. This matches the two pinned-DNS transports already in apps/web, keeps Host and SNI, and meets the brief's goal without adding undici.
Answer: Injectable requestImpl, renamed from fetchImpl (Recommended)
Confidence: 0.70 · Precedent: Speed and least work: "skip work that doesn't need to be done" (00eb2a1d3e4b). Renaming the seam is far cheaper than rewriting about 15 DB-backed setups, and pinning is still proven against the real default.
Answer: Keep non-fetch prechecks (Recommended)
Confidence: 0.75 · Precedent: The brief says to remove the precheck only "where the shared path replaces it". Removing all of them would drop validation at creation for authMode:none configs.
Answer: New pure unit tests with a fake DNS resolver (Recommended)
Confidence: 0.75 · Precedent: Proof and verification: "only run it for a targeted subset of files" (df491946927a). The brief asks for unit tests of the bound address. The DB-backed oauth-flow suite still runs for end-to-end proof on the PR.