Skip to content

Add enableSessionTelemetry session option across SDKs#1224

Merged
stephentoub merged 8 commits into
mainfrom
davsterl_enableSessionTelemetry
May 7, 2026
Merged

Add enableSessionTelemetry session option across SDKs#1224
stephentoub merged 8 commits into
mainfrom
davsterl_enableSessionTelemetry

Conversation

@stephentoub
Copy link
Copy Markdown
Collaborator

@stephentoub stephentoub commented May 7, 2026

Replaces #1214 which was having CI issues. Thanks, @Davsterl.

Davsterl and others added 5 commits May 7, 2026 14:53
Adds an optional enableSessionTelemetry field to SessionConfig and
ResumeSessionConfig across Node.js, Python, Go, and .NET SDKs.

When omitted (default), session telemetry remains enabled — no extra
parameter is needed. When set to false, internal session telemetry
(Hydro/AppInsights) is disabled for that session.

Includes unit tests for serialization, cloning, and wire forwarding
in all four languages.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
- Enrich XML/JSDoc/comment docs across all SDKs: explain default behavior,
  clarify independence from OpenTelemetry config
- Add two .NET E2E tests validating wire serialization of enableSessionTelemetry
- Fix gofmt alignment in Go test (CI failure)

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

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Clarify that when a custom provider (BYOK) is configured, session
telemetry is always disabled regardless of the enableSessionTelemetry
setting. Updated Node.js, Go, and Python to match .NET docs.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 7, 2026 18:53
@stephentoub stephentoub requested a review from a team as a code owner May 7, 2026 18:53
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a new per-session option to enable/disable internal session telemetry and wires it through all SDKs (Python/Node/Go/.NET), with accompanying unit/E2E coverage to ensure the flag is forwarded (and omitted when unset where applicable).

Changes:

  • Add enableSessionTelemetry / enable_session_telemetry to session create/resume configuration types across SDKs.
  • Forward the option into the session.create and session.resume JSON-RPC payloads.
  • Add tests in each language to validate forwarding/serialization behavior.
Show a summary per file
File Description
python/test_client.py Adds unit tests asserting the Python client forwards enableSessionTelemetry on create/resume.
python/copilot/session.py Documents new enable_session_telemetry fields on SessionConfig/ResumeSessionConfig.
python/copilot/client.py Adds enable_session_telemetry params and forwards to wire payload when set.
nodejs/test/client.test.ts Adds unit tests asserting forwarding on session.create/session.resume.
nodejs/src/types.ts Extends SessionConfig/ResumeSessionConfig types with enableSessionTelemetry and docs.
nodejs/src/client.ts Forwards enableSessionTelemetry in create/resume requests.
go/types.go Adds config fields and includes enableSessionTelemetry in wire request structs.
go/client.go Forwards EnableSessionTelemetry from public configs into RPC request payloads.
go/client_test.go Adds JSON marshal tests ensuring the field is included when set and omitted when nil.
dotnet/test/Unit/SerializationTests.cs Adds serialization assertions for enableSessionTelemetry in request payloads.
dotnet/test/Unit/CloneTests.cs Extends clone tests to cover EnableSessionTelemetry copy/default behavior.
dotnet/test/E2E/ClientOptionsE2ETests.cs Adds E2E coverage for forwarding and omission on the wire request.
dotnet/src/Types.cs Adds EnableSessionTelemetry to SessionConfig/ResumeSessionConfig and their clone/copy constructors.
dotnet/src/Client.cs Threads EnableSessionTelemetry into internal request records for create/resume.

Copilot's findings

Comments suppressed due to low confidence (1)

python/copilot/session.py:970

  • Same documentation issue as above: this comment mentions "CopilotClientOptions" which is not a Python SDK type. Please reference the Python configuration type (e.g., SubprocessConfig.telemetry) or rephrase to avoid a non-existent API name.
    # Enables or disables internal session telemetry. When False, disables session
    # telemetry. When omitted (the default) or True, telemetry is enabled for
    # GitHub-authenticated sessions. When a custom provider (BYOK) is configured,
    # session telemetry is always disabled regardless of this setting.
    # This is independent of the OpenTelemetry configuration in CopilotClientOptions.
    enable_session_telemetry: bool
  • Files reviewed: 14/14 changed files
  • Comments generated: 1

Comment thread python/copilot/session.py Outdated
@github-actions

This comment has been minimized.

@stephentoub stephentoub changed the title Testing CI Add enableSessionTelemetry session option across SDKs May 7, 2026
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@stephentoub
Copy link
Copy Markdown
Collaborator Author

Included in 5d67686. Added enable_session_telemetry to Rust SessionConfig and ResumeSessionConfig with serde camelCase output, defaults and Debug wiring, builder helpers, and serialization/builder coverage. This response was generated by Copilot.

@github-actions

This comment has been minimized.

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

This comment has been minimized.

Register the idle event listener before sending the rejected tool result turn so fast runtimes cannot emit session.idle before the test starts waiting for it.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 7, 2026

Cross-SDK Consistency Review ✅

This PR adds enableSessionTelemetry to SessionConfig and ResumeSessionConfig across all five SDK implementations. The changes are consistent:

SDK Type createSession resumeSession Tests
Node.js enableSessionTelemetry?: boolean
Python enable_session_telemetry: bool (optional via total=False)
Go EnableSessionTelemetry *bool
.NET bool? EnableSessionTelemetry
Rust enable_session_telemetry: Option<bool> ✅ (via serde_json::to_value) ✅ (via serde_json::to_value)

Wire format: All SDKs correctly serialize to enableSessionTelemetry (camelCase) and omit the field when it's not set (null/None/undefined), matching the expected JSON-RPC protocol behavior.

Semantics are consistent across all SDKs:

  • false → explicitly disables session telemetry
  • omitted/null/None → default behavior (telemetry enabled for GitHub-authenticated sessions)
  • Custom provider (BYOK) → always disables telemetry regardless of this setting

No consistency issues found. 🎉

Generated by SDK Consistency Review Agent for issue #1224 · ● 550.5K ·

@stephentoub stephentoub merged commit 2f9601a into main May 7, 2026
43 checks passed
@stephentoub stephentoub deleted the davsterl_enableSessionTelemetry branch May 7, 2026 20:20
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.

3 participants