Emit agentSkillsFound telemetry from Agent Host - #325039
Emit agentSkillsFound telemetry from Agent Host#325039Aaron Munger (amunger) wants to merge 1 commit into
Conversation
Subscribes to the SDK's session.skills_loaded event and emits an agentSkillsFound event under the workbench kind so existing dashboards keep working when we swap to the Agent Host. Adds AH discriminator fields (provider, agentSessionId, isSubagentSession) so rows can be split from local emissions. Local per-source buckets that the SDK does not distinguish (claudePersonal, claudeWorkspace, githubWorkspace, agentsWorkspace, extensionAPI) and the skipped-file counters (SDK only reports loaded skills) are intentionally omitted. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR adds agentSkillsFound telemetry emission from the Agent Host (Copilot CLI) side. It subscribes to the SDK's session.skills_loaded event and reports skill counts bucketed by source, mirroring local chat's emitter in promptsServiceImpl.ts but carrying only the subset of fields derivable from the SDK's skill list, plus Agent Host discriminator fields (provider, agentSessionId, isSubagentSession) so AH rows can be distinguished from local rows.
Changes:
- Adds an
onSkillsLoadedevent getter toCopilotSessionWrapper, following the existing memoized??= this._sdkEvent(...)pattern. - Adds
_subscribeForAgentSkillsFoundTelemetry()inCopilotAgentSession, wired during construction after the wrapper is registered, which maps SDK skillsourcevalues into telemetry buckets and emitsagentSkillsFound. - Reuses the existing
agentSkillsFoundevent name with a documented "semantic shift" for shared field names (vendor-specific workspace tiers and skip reasons are intentionally omitted).
Show a summary per file
| File | Description |
|---|---|
src/vs/platform/agentHost/node/copilot/copilotSessionWrapper.ts |
Exposes a new memoized onSkillsLoaded event wrapping the SDK's session.skills_loaded. |
src/vs/platform/agentHost/node/copilot/copilotAgentSession.ts |
Subscribes to onSkillsLoaded and emits agentSkillsFound telemetry with AH discriminator fields; imports AgentSession and isSubagentSession. |
Note: I could not verify the SDK's SkillsLoadedSkill.source string-literal values against the switch cases (personal-copilot, personal-agents, plugin, project, inherited, custom, builtin), because the @github/copilot-sdk types are not vendored in this checkout. These would only be caught by compilation, and the telemetry reuses an existing event name with deliberately divergent field semantics — a GDPR/telemetry decision that benefits from human sign-off.
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 0
- Review effort level: Medium
uses the SDK's session.skills_loaded, and adds AH discriminator fields (provider, agentSessionId, isSubagentSession)