Add enableSessionTelemetry session option across SDKs#1224
Conversation
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>
There was a problem hiding this comment.
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_telemetryto session create/resume configuration types across SDKs. - Forward the option into the
session.createandsession.resumeJSON-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
This comment has been minimized.
This comment has been minimized.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
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. |
This comment has been minimized.
This comment has been minimized.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This comment has been minimized.
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>
Cross-SDK Consistency Review ✅This PR adds
Wire format: All SDKs correctly serialize to Semantics are consistent across all SDKs:
No consistency issues found. 🎉
|
Replaces #1214 which was having CI issues. Thanks, @Davsterl.