Coalesce intercepted HTTP response chunks - #2734
Conversation
6e29315 to
dafaf41
Compare
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The Go no-progress read path can ignore cancellation and indefinitely block response cleanup.
Get a fresh assessment by requesting another Copilot review.
Review effort: Balanced
Findings: 1
Open (1)
What changed in this PR
Adds bounded HTTP response read-ahead and chunk coalescing across five SDKs while improving cancellation and connection-loss handling.
Changes:
- Coalesces response fragments with one outstanding data RPC.
- Adds prompt source cancellation and binary-safe Go forwarding.
- Adds protocol tests and Java JSON-RPC close handling.
| File | Description |
|---|---|
python/test_copilot_request_handler_response.py |
Tests response forwarding and cancellation. |
python/copilot/copilot_request_handler.py |
Adds bounded response read-ahead. |
python/copilot/client.py |
Cancels pending exchanges on disconnect. |
nodejs/tsconfig.test.json |
Includes the new protocol tests. |
nodejs/test/copilot-request-handler.test.ts |
Tests coalescing and cancellation. |
nodejs/src/copilotRequestHandler.ts |
Adds response buffering and source cancellation. |
nodejs/src/client.ts |
Cancels pending responses on disconnect. |
java/sdk/src/test/java/com/github/copilot/JsonRpcClientTest.java |
Tests invocation failure after closure. |
java/sdk/src/test/java/com/github/copilot/HttpResponseForwardingTest.java |
Tests Java response forwarding. |
java/sdk/src/main/java/com/github/copilot/LlmInferenceExchange.java |
Adds asynchronous response writes. |
java/sdk/src/main/java/com/github/copilot/LlmInferenceAdapter.java |
Cancels pending exchanges. |
java/sdk/src/main/java/com/github/copilot/JsonRpcClient.java |
Fails pending requests on closure. |
java/sdk/src/main/java/com/github/copilot/HttpResponseReader.java |
Implements bounded background reading. |
java/sdk/src/main/java/com/github/copilot/CopilotRequestHandler.java |
Integrates asynchronous read-ahead. |
java/sdk/src/main/java/com/github/copilot/CopilotClient.java |
Wires disconnect cancellation. |
go/http_response_reader.go |
Implements bounded response buffering. |
go/http_response_forwarding_test.go |
Tests Go protocol behavior. |
go/copilot_request_handler.go |
Adds binary forwarding and cancellation. |
go/client.go |
Tracks and closes request adapters. |
dotnet/test/Unit/CopilotRequestHandlerProtocolTests.cs |
Tests .NET response forwarding. |
dotnet/src/CopilotRequestHandler.cs |
Adds bounded asynchronous buffering. |
dotnet/src/Client.cs |
Cancels pending exchanges on disconnect. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This comment has been minimized.
This comment has been minimized.
dafaf41 to
2a5793e
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
73c33ac to
31e978f
Compare
This comment has been minimized.
This comment has been minimized.
31e978f to
f47cd56
Compare
This comment has been minimized.
This comment has been minimized.
f47cd56 to
8a49570
Compare
This comment has been minimized.
This comment has been minimized.
8a49570 to
88b2501
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Add bounded 32 KiB read-ahead across Node.js, Python, Go, .NET, and Java while preserving byte ordering, cancellation, and a single outstanding data RPC. Add protocol-level coverage for backpressure, cancellation, connection loss, and upstream errors. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Synchronize the resumed session event list while callbacks and assertions access it to avoid collection-modified failures in the Windows E2E matrix. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
44f2c14 to
8748b6e
Compare
Cross-SDK Consistency Review — PR #2734This PR ("Coalesce intercepted HTTP response chunks" + follow-up fixes) touches Node.js, Python, Go, .NET, and Java, adding two related capabilities to the
Finding: Rust SDK not updated for capability #2Feature parity gap. The Rust SDK ( However, capability #2 (proactively cancelling pending
Suggestion: Consider adding a Everything else: consistent ✅
|

Summary
llmInference.httpResponseChunkdata RPC outstanding while preserving byte/error order and immediate partial flushingValidation
gofmtandgo test ./...Throwaway real-transport benchmarks showed substantial gains for typical small streaming fragments across all five SDKs; no benchmark code is included.
Generated by Copilot