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
This comment has been minimized.
This comment has been minimized.
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
Keep initial Responses events in progress and empty until their matching delta and done events, and use the isolated E2E context when injecting a BYOK provider. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 85a40918-bd95-440b-b6e9-97c757a71f8c
SDK Consistency ReviewSummary: This PR adds BYOK (Anthropic Messages, OpenAI Responses, OpenAI Chat Completions) E2E test coverage to the .NET SDK harness. It does not modify any SDK public API surface. ScopeAll 44 changed files are in:
No SDK source code is modified in any language. Cross-SDK Consistency Assessment✅ No API consistency issues. The public API surface across all six SDKs (Node.js, Python, Go, .NET, Java, Rust) is unchanged. Informational: BYOK E2E Coverage GapThe shared replay harness ( The other SDKs (Node.js, Go, Python, Java, Rust) do not yet have equivalent BYOK backend E2E test matrix legs. This is not a defect introduced by this PR — those gaps existed before — but future work could extend this coverage to other SDKs using the same shared harness infrastructure. VerdictThis PR maintains cross-SDK API consistency. The BYOK E2E infrastructure is additive and non-breaking. Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "awmgmcpg"See Network Configuration for more information.
|
SteveSandersonMS
left a comment
There was a problem hiding this comment.
Excellent - this looks extremely nice.
Very glad to see this detected divergences between the behaviors of different providers. We should look into these as follow-ups.
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. We do this for .NET since we run that in the runtime repo as well for early regression discovery.
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.