Skip to content

Fix telemetry forwarding handshake CI failures#1909

Merged
stephentoub merged 8 commits into
mainfrom
fix-ci-telemetry-handshake
Jul 5, 2026
Merged

Fix telemetry forwarding handshake CI failures#1909
stephentoub merged 8 commits into
mainfrom
fix-ci-telemetry-handshake

Conversation

@stephentoub

Copy link
Copy Markdown
Collaborator

Summary

  • Send the GitHub telemetry forwarding opt-in during the connection handshake across SDKs.
  • Keep generated RPC files aligned by moving the extra handshake field into SDK-owned payload types.
  • Update Go, .NET, and Rust tests for optional telemetry session ID / allow-all schema fields.

Validation

  • cd nodejs && npm test -- client.test.ts
  • cd python && python -m pytest test_client.py
  • cd go && go test . ./rpc ./internal/e2e -run TestDoesNotExist
  • cd dotnet && dotnet test test\GitHub.Copilot.SDK.Test.csproj --no-restore --filter "FullyQualifiedName~GitHubTelemetry" -m:1
  • cd rust && cargo test --all-features github_telemetry

Not run locally: Java Maven validation (mvn is not available in this environment).

Generated by Copilot

stephentoub and others added 5 commits July 4, 2026 21:59
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>
Copilot AI review requested due to automatic review settings July 5, 2026 02:13
@stephentoub stephentoub requested a review from a team as a code owner July 5, 2026 02:13

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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=true to the connect handshake 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 connect payload 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

Comment thread rust/src/lib.rs Outdated
Comment thread rust/src/lib.rs Outdated
@stephentoub stephentoub self-assigned this Jul 5, 2026
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>
@github-actions

This comment has been minimized.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@github-actions

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>
@github-actions

github-actions Bot commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Cross-SDK Consistency Review ✅

This PR implements enableGitHubTelemetryForwarding in the connect handshake consistently across all six SDKs. Here's a quick summary:

SDK Connect handshake flag Unit tests MCP OAuth status update
Node.js
Python
Go
.NET
Java
Rust

Notable observations

Rust gains stricter protocol version validation — Rust now returns InvalidProtocolVersion when the server reports a version outside u32 range, rather than silently succeeding with None. The other SDKs either silently truncate or may throw a language-level overflow exception. This is a correctness improvement, but if consistency of error-handling semantics matters, the other SDKs could benefit from a similar guard. Not blocking.

Java connect handshake uses HashMap instead of a typed struct — For session.create and session.resume, Java uses typed CreateSessionRequest/ResumeSessionRequest objects (with setEnableGitHubTelemetryForwarding()). For the new connect handshake, it uses an untyped HashMap<String, Object>. This is a reasonable pragmatic choice (the generated ConnectParams type didn't include the new field) and an internal implementation detail, but it's slightly inconsistent with the pattern used elsewhere in the Java SDK. Not blocking.

Overall the PR is well-structured and maintains feature parity across all SDKs.

Generated by SDK Consistency Review Agent for issue #1909 · sonnet46 1.6M ·

@stephentoub stephentoub merged commit b14b743 into main Jul 5, 2026
42 checks passed
@stephentoub stephentoub deleted the fix-ci-telemetry-handshake branch July 5, 2026 14:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants