Python: fix(github-copilot): forward telemetry config to client - #7625
Python: fix(github-copilot): forward telemetry config to client#7625Ruiming Zhao (uuzzrm) wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Pull request overview
Forwards GitHub Copilot CLI telemetry configuration from agent options to the SDK client.
Changes:
- Adds typed telemetry configuration to public options and client settings.
- Prevents telemetry from leaking into session arguments.
- Adds regression tests for both boundaries.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
_agent.py |
Resolves and forwards telemetry to CopilotClient. |
test_github_copilot_agent.py |
Verifies client forwarding and session exclusion. |
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
Python Test Coverage Report •
Python Unit Test Overview
|
||||||||||||||||||||||||||||||
| timeout: float | None | ||
| log_level: str | None | ||
| base_directory: str | None | ||
| telemetry: dict[str, Any] |
There was a problem hiding this comment.
Could we parse and validate this setting before handing it to the SDK, or keep it out of GitHubCopilotSettings? load_settings leaves GITHUB_COPILOT_TELEMETRY and .env values as strings, so a normal JSON value reaches CopilotClient; SDK 1.0.2 then indexes it as telemetry["otlp_endpoint"] during start() and raises TypeError, preventing the agent from starting. An explicit json.loads into a validated TelemetryConfig would preserve the documented environment path.
Motivation & Context
GitHubCopilotAgentcan accept Copilot CLI telemetry configuration, but the setting was not reaching theCopilotClientthat starts the CLI process. That made it impossible to enable the CLI's model and tool spans through the agent configuration described in issue #7624.Description & Review Guide
TelemetryConfigto the public GitHub Copilot options.CopilotClient.create_sessionoptions, where it is not a valid session argument.Related Issue
Fixes #7624
Validation
uv run poe --directory packages/github_copilot test --no-cov— 152 passed, 6 integration tests deselecteduv run poe --directory packages/github_copilot syntax— passeduv run poe --directory packages/github_copilot build— passedgit diff --check— passedThe repository's current MyPy baseline reports two pre-existing errors on
upstream/mainin_parse_usageandBlobAttachment. Pyright could not start in this environment because the installed Node binary has a missing Homebrewllhttplibrary; neither issue is related to this change.Contribution Checklist