close
Skip to content

agentHost: declare initiatorType on restricted engine snapshots - #346594

Merged
Karthik Nadig (karthiknadig) merged 1 commit into
mainfrom
agents/engine-call-initiator-type
Nov 7, 2026
Merged

Karthik Nadig (karthiknadig) merged 1 commit into
mainfrom
agents/engine-call-initiator-type

Conversation

@karthiknadig

@karthiknadig Karthik Nadig (karthiknadig) commented Nov 6, 2026 •

Copy link
Copy Markdown
Member

What and why

Follow-up to #346455 (merged), which declared the per-call metadata the Copilot runtime will attach to restricted engine.messages and engine.messages.length snapshots. Those fields still cannot tell the call that starts a user's turn from the agent's follow-up calls in the same conversation.

A follow-up runtime update adds initiatorType to these snapshots: user or agent, with the same values and meaning as initiatorType on the runtime's model response event.

  • Declares initiatorType in the AgentHostRestrictedEngineCall fragment. The router already passes runtime properties through unchanged, so the field flows as soon as the runtime sends it. Older runtimes omit it, and the router leaves it absent.
  • Documents the field in src/vs/platform/agentHost/AGENTS.md.

Related to microsoft/vscode-internalbacklog#10632.

Scope

No new event, destination, consent check or content-exclusion change, and no runtime code change in the Agent Host. Until the runtime dependency is updated, nothing new is sent.

How to test

pnpm run test-node --run src/vs/platform/agentHost/test/node/agentHostGitHubTelemetryRouter.test.ts --run src/vs/platform/agentHost/test/node/agentHostRestrictedTelemetry.test.ts

Result: 31 passing. The per-call metadata test now also checks initiatorType in the upload envelopes: user on a root call, agent on a subagent call, and absent for a call from an older runtime.

pnpm run eslint src/vs/platform/agentHost/node/agentHostGitHubTelemetryRouter.ts src/vs/platform/agentHost/test/node/agentHostGitHubTelemetryRouter.test.ts

Result: passed.

Base automatically changed from agents/metadata-assessment-and-fix-suggestion to main November 6, 2026 17:46
Engine snapshots from newer runtimes say whether a user or an agent initiated each model call. Declare the field and pin its pass-through, so the call that starts a user's turn can be told apart from the agent's follow-up calls.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@karthiknadig
Karthik Nadig (karthiknadig) force-pushed the agents/engine-call-initiator-type branch from 1a1b5f4 to 309c20e Compare November 6, 2026 17:54
Copilot AI balanced review requested due to automatic review settings November 6, 2026 17:54

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.

🟢 Approval recommended

No active review issues remain for the initiatorType metadata change.

No open issues 🎉

What changed in this PR

Extends the per-call metadata declaration from #346455 with initiatorType for restricted engine snapshots, distinguishing user-initiated calls from agent follow-ups without changing runtime routing.

Changes:

  • Declares initiatorType as restricted telemetry metadata and documents its meaning.
  • Extends upload-envelope assertions for user, agent, and absence in older runtimes.

No actionable findings remain.

File Description
src/​vs/​platform/​agentHost/​test/​node/​agentHostGitHubTelemetryRouter.test.ts Checks both initiator values and backward-compatible absence.
src/​vs/​platform/​agentHost/​node/​agentHostGitHubTelemetryRouter.ts Adds the telemetry classification declaration for initiatorType.
src/​vs/​platform/​agentHost/​AGENTS.md Documents the field’s values and per-call meaning.

Review effort: Balanced

@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Screenshot Changes

Base: 169a1c16 Current: 815053ce

Changed (1)

sessions/chat/newWidget/newChatWidget/NewSessionComparisonSetup/Light
Before After
before after

@karthiknadig
Karthik Nadig (karthiknadig) merged commit df8b839 into main Nov 7, 2026
52 checks passed
@karthiknadig
Karthik Nadig (karthiknadig) deleted the agents/engine-call-initiator-type branch November 7, 2026 19:11
@vs-code-engineering vs-code-engineering Bot added this to the 1.146.0 milestone Nov 7, 2026
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