Add .NET BYOK E2E coverage#2010
Conversation
Reuse conceptual replay snapshots across Anthropic Messages, OpenAI Responses, and OpenAI Chat Completions, and add three Ubuntu in-process CI legs. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 85a40918-bd95-440b-b6e9-97c757a71f8c
Collapse runtime-specific blank-line expansion so conceptual replay snapshots match recovery turns consistently. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 85a40918-bd95-440b-b6e9-97c757a71f8c
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 85a40918-bd95-440b-b6e9-97c757a71f8c
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 85a40918-bd95-440b-b6e9-97c757a71f8c
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 85a40918-bd95-440b-b6e9-97c757a71f8c
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 85a40918-bd95-440b-b6e9-97c757a71f8c
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 85a40918-bd95-440b-b6e9-97c757a71f8c
Make non-CAPI replay explicitly read-only so provider response parsing and SSE aggregation are unnecessary. Keep protocol-complete forward rendering, clarify backend trait naming, and rename the .NET proxy wrapper to reflect its protocol-neutral role. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 85a40918-bd95-440b-b6e9-97c757a71f8c
Select a protocol descriptor once per backend so CAPI and BYOK share routing, canonical matching, errors, JSON/SSE responses, and exchange inspection. Replay compaction directly from canonical snapshots instead of synthesizing provider-specific responses. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 85a40918-bd95-440b-b6e9-97c757a71f8c
Preserve both protocol coalescing and stable built-in tool normalization while resolving the replay proxy conflict. Replace UnreachableException with a net472-compatible exception and remove the unused adapter import. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 85a40918-bd95-440b-b6e9-97c757a71f8c
SDK Consistency Review ✅This PR adds two features across all six SDK implementations (Node.js, Python, Go, .NET, Java, Rust) with consistent API design: 1.
|
There was a problem hiding this comment.
Pull request overview
Adds .NET BYOK E2E coverage by adapting Anthropic and OpenAI protocols to the canonical replay snapshot format.
Changes:
- Adds Anthropic Messages and OpenAI Responses adapters.
- Centralizes .NET E2E backend/provider selection.
- Adds three Ubuntu in-process BYOK CI legs and backend traits.
Show a summary per file
| File | Description |
|---|---|
test/harness/responsesApiAdapter.ts |
Adapts OpenAI Responses requests and responses. |
test/harness/replayingCapiProxy.ts |
Adds protocol-aware, read-only BYOK replay. |
test/harness/modelProtocolAdapterShared.ts |
Defines shared adapter utilities. |
test/harness/modelProtocolAdapters.test.ts |
Tests adapters and backend replay. |
test/harness/anthropicMessagesAdapter.ts |
Adapts Anthropic Messages requests and responses. |
dotnet/test/Unit/E2ETestBackendTests.cs |
Tests backend configuration. |
dotnet/test/Harness/ReplayProxy.cs |
Renames and configures the replay proxy wrapper. |
dotnet/test/Harness/E2ETestContext.cs |
Applies selected backends to sessions. |
dotnet/test/Harness/E2ETestBase.cs |
Routes session operations through context. |
dotnet/test/Harness/E2ETestBackend.cs |
Defines backend configuration and traits. |
dotnet/test/E2E/ToolsE2ETests.cs |
Uses backend-aware session creation. |
dotnet/test/E2E/TelemetryExportE2ETests.cs |
Uses backend-aware session creation. |
dotnet/test/E2E/SuspendE2ETests.cs |
Uses backend-aware create/resume helpers. |
dotnet/test/E2E/SubagentHooksE2ETests.cs |
Uses backend-aware session creation. |
dotnet/test/E2E/StreamingFidelityE2ETests.cs |
Adds backend classification and resume routing. |
dotnet/test/E2E/SessionFsSqliteE2ETests.cs |
Routes sessions through context. |
dotnet/test/E2E/SessionFsE2ETests.cs |
Routes create/resume operations through context. |
dotnet/test/E2E/SessionE2ETests.cs |
Adds backend classifications and resume routing. |
dotnet/test/E2E/SessionConfigE2ETests.cs |
Classifies provider-specific scenarios. |
dotnet/test/E2E/RpcTasksAndHandlersE2ETests.cs |
Marks a CAPI-only scenario. |
dotnet/test/E2E/RpcSessionStateExtrasE2ETests.cs |
Classifies model/provider tests. |
dotnet/test/E2E/RpcSessionStateE2ETests.cs |
Uses backend-aware session creation. |
dotnet/test/E2E/RpcServerE2ETests.cs |
Classifies and routes RPC session tests. |
dotnet/test/E2E/RpcMcpAndSkillsE2ETests.cs |
Routes sessions through context. |
dotnet/test/E2E/RpcExtensionsLoadedE2ETests.cs |
Routes extension sessions through context. |
dotnet/test/E2E/ProviderEndpointE2ETests.cs |
Classifies provider endpoint tests. |
dotnet/test/E2E/PerSessionAuthE2ETests.cs |
Marks authentication tests CAPI-only. |
dotnet/test/E2E/PermissionE2ETests.cs |
Uses backend-aware resume handling. |
dotnet/test/E2E/PendingWorkResumeE2ETests.cs |
Routes pending-work sessions through context. |
dotnet/test/E2E/MultiProviderRegistryE2ETests.cs |
Marks self-configured provider coverage. |
dotnet/test/E2E/MultiClientE2ETests.cs |
Routes multi-client sessions through context. |
dotnet/test/E2E/MultiClientCommandsElicitationE2ETests.cs |
Routes multi-client command sessions. |
dotnet/test/E2E/ModeHandlersE2ETests.cs |
Marks mode-handler tests CAPI-only. |
dotnet/test/E2E/ModeEmptyE2ETests.cs |
Uses backend-aware session creation. |
dotnet/test/E2E/GitHubTelemetryForwardingE2ETests.cs |
Marks telemetry forwarding CAPI-only. |
dotnet/test/E2E/CopilotRequestWebSocketE2ETests.cs |
Marks self-configured WebSocket coverage. |
dotnet/test/E2E/CopilotRequestSessionIdE2ETests.cs |
Classifies CAPI and BYOK session-ID tests. |
dotnet/test/E2E/CopilotRequestCancelErrorE2ETests.cs |
Routes request-handler sessions through context. |
dotnet/test/E2E/ClientOptionsE2ETests.cs |
Applies backend-aware session helpers. |
dotnet/test/E2E/ClientE2ETests.cs |
Integrates the E2E context fixture. |
dotnet/test/E2E/ByokBearerTokenProviderE2ETests.cs |
Marks explicit BYOK provider tests. |
dotnet/test/AssemblyInfo.cs |
Updates replay proxy terminology. |
.github/workflows/dotnet-sdk-tests.yml |
Adds BYOK CI matrix legs and filtering. |
.github/instructions/dotnet-e2e.instructions.md |
Documents backend-aware E2E authoring. |
Review details
- Files reviewed: 44/44 changed files
- Comments generated: 3
- Review effort level: Medium
| var isolatedClient = isolatedCtx.CreateClient(); | ||
|
|
||
| await using var session = await isolatedClient.CreateSessionAsync(new SessionConfig | ||
| await using var session = await Ctx.CreateSessionAsync(isolatedClient, new SessionConfig |
| const skeleton = { | ||
| ...fullResponse, | ||
| output: [], | ||
| output_text: "", | ||
| usage: undefined, | ||
| }; |
| const item = fullResponse.output[outputIndex]; | ||
| chunks.push( | ||
| event("response.output_item.added", { | ||
| output_index: outputIndex, | ||
| item, | ||
| }), |
The SDK's E2E suites currently validate only the CAPI path, leaving BYOK protocol regressions undetected until later integration stages. This adds .NET coverage for Anthropic Messages, OpenAI Responses, and OpenAI Chat Completions while continuing to use the existing conceptual snapshot corpus.
Approach
The shared replay harness remains protocol-neutral despite retaining its existing TypeScript class name for compatibility with other SDKs. The .NET wrapper is renamed to
ReplayProxy.Validation
apply_patch/rgversusedit/grep), not response-envelope rendering.