Fix telemetry forwarding handshake CI failures#1909
Conversation
The runtime moved the `enableGitHubTelemetryForwarding` opt-in from `session.create` to the connection-level `connect` handshake, so it can forward the first session's un-replayable `session.start` event. SDKs only sent the flag on session.create/resume, so against a post-move runtime nothing opted the connection in and GitHub telemetry forwarding timed out. Dual-send the flag across all six SDKs: send it on `connect` (when a GitHub telemetry handler is registered) in addition to the existing session.create/resume send. This is backward and forward compatible; unknown fields are ignored by both old and new runtimes. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
- python/test_client.py: restore test_event_routes_to_handler as its own test method; the connect-omit test had accidentally absorbed the telemetry dispatch body, so keep it limited to the connect assertion. - dotnet/test/Unit/GitHubTelemetryTests.cs: tighten Connect_Does_Not_Opt_In_Without_Handler to require the flag be absent or null, so it fails if `false` is ever sent (matches the other SDKs). Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Move connect telemetry forwarding onto SDK-owned handshake payloads so generated RPC files stay aligned with the published schema while preserving the wire field name. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Update .NET and Go tests for schema changes that made telemetry session ids and allow-all toggles optional in generated RPC types. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Update Rust telemetry and allow-all tests for generated RPC fields that are now optional. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR updates the cross-SDK connection handshake so that GitHub telemetry forwarding opt-in is sent during connect when a telemetry handler/callback is registered, preventing handshake-related CI failures and aligning behavior across languages.
Changes:
- Add
enableGitHubTelemetryForwarding=trueto theconnecthandshake across Node.js, Python, Go, .NET, Java, and Rust when a GitHub telemetry handler is provided (and omit it otherwise). - Adjust SDK tests to cover the new handshake behavior and to tolerate optional
sessionId/ allow-all permission schema fields. - In Rust, construct the
connectpayload locally (instead of using the generated request struct) to control the exact wire field name.
Show a summary per file
| File | Description |
|---|---|
| rust/tests/session_test.rs | Adds handshake tests for telemetry opt-in + adjusts sessionId assertions to handle optionality. |
| rust/tests/e2e/rpc_session_state_extras.rs | Updates allow-all permission request construction for optional fields. |
| rust/tests/e2e/github_telemetry.rs | Updates telemetry E2E assertion to handle optional session ID. |
| rust/src/lib.rs | Sends telemetry opt-in during connect by building handshake params inline and calling connect via raw RPC. |
| python/test_client.py | Adds unit tests asserting connect includes/omits the forwarding flag based on handler presence. |
| python/copilot/client.py | Sends telemetry forwarding opt-in during connect when on_github_telemetry is set. |
| nodejs/test/client.test.ts | Adds tests verifying connect carries/omits the forwarding flag. |
| nodejs/src/client.ts | Includes telemetry forwarding opt-in during connect when onGitHubTelemetry is provided. |
| java/src/test/java/com/github/copilot/GitHubTelemetryTest.java | Extends telemetry test harness to assert connect forwarding flag behavior. |
| java/src/main/java/com/github/copilot/CopilotClient.java | Adds forwarding opt-in to connect handshake parameters when handler is registered. |
| go/internal/e2e/rpc_session_state_extras_e2e_test.go | Updates allow-all permission request to use optional boolean pointers. |
| go/internal/e2e/github_telemetry_e2e_test.go | Updates telemetry E2E assertion for optional SessionID. |
| go/client.go | Adds forwarding opt-in to connect handshake request when handler is registered. |
| go/client_test.go | Adds unit tests verifying forwarding opt-in is present/absent on connect. |
| dotnet/test/Unit/GitHubTelemetryTests.cs | Adds unit tests asserting connect carries/omits forwarding flag and captures connect params in fake server. |
| dotnet/test/E2E/RpcSessionStateExtrasE2ETests.cs | Updates E2E calls to match updated allow-all permissions API shape. |
| dotnet/test/E2E/GitHubTelemetryForwardingE2ETests.cs | Updates E2E assertion to allow empty/null SessionId patterns. |
| dotnet/src/Client.cs | Adds a ConnectHandshakeRequest and includes forwarding opt-in in connect when handler is set. |
Review details
- Files reviewed: 18/18 changed files
- Comments generated: 2
- Review effort level: Low
Use the generated ConnectRequest for the connect handshake and reject invalid server protocolVersion values instead of treating them as omitted. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This comment has been minimized.
This comment has been minimized.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This comment has been minimized.
This comment has been minimized.
Seed Spotless' Eclipse formatter P2 query cache from Maven Central before running the Java formatter check so CI does not depend on the flaky Eclipse P2 HTTP/2 bootstrap path. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Cross-SDK Consistency Review ✅This PR implements
Notable observationsRust gains stricter protocol version validation — Rust now returns Java connect handshake uses Overall the PR is well-structured and maintains feature parity across all SDKs.
|
Summary
Validation
cd nodejs && npm test -- client.test.tscd python && python -m pytest test_client.pycd go && go test . ./rpc ./internal/e2e -run TestDoesNotExistcd dotnet && dotnet test test\GitHub.Copilot.SDK.Test.csproj --no-restore --filter "FullyQualifiedName~GitHubTelemetry" -m:1cd rust && cargo test --all-features github_telemetryNot run locally: Java Maven validation (
mvnis not available in this environment).Generated by Copilot