Skip to content

agentHost: preserve the engine snapshot pairing ID namespace - #345229

Merged
Aaron Munger (amunger) merged 3 commits into
mainfrom
agents/investigate-and-implement-a-solution-that-satisf
Nov 3, 2026
Merged

Aaron Munger (amunger) merged 3 commits into
mainfrom
agents/investigate-and-implement-a-solution-that-satisf

Conversation

@amunger

@amunger Aaron Munger (amunger) commented Oct 30, 2026 •

Copy link
Copy Markdown
Collaborator

What and why

Keep missing engine input/output pairing IDs missing, rather than replacing them with an unrelated SDK model-call ID.

The restricted router falls back from properties.modelCallId to the top-level model_call_id for every target event. Engine snapshots mint their own input/output pairing UUID, so that fallback can manufacture an invalid correlation key. This change excludes engine.messages and engine.messages.length from the fallback.

For example, an engine snapshot with no pairing UUID and SDK ID sdk-call-A previously acquired modelCallId: sdk-call-A. It now remains unpaired instead of presenting that unrelated ID as an engine pairing key. Other target events keep their existing fallback.

This complements #345609: sdkSessionId / sdkAgentId identify the conversation and child trajectory, while engine modelCallId pairs an individual model input/output. Conversation correlation remains available even when the engine pairing ID is missing.

Scope

The change is limited to the restricted router and its regression tests. It does not change content collection, consent, destinations, SDK dependencies or downstream admission. The tests no longer depend on the earlier host-provided ownership proposal.

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 --run src/vs/platform/agentHost/test/node/copilotGitHubTelemetryForwarder.test.ts

Result: 48 passed using the same Node test runner directly after refreshing the six selected telemetry modules and one newly added test helper with the repository's transpileFile helper. Other compiled dependencies were reused; this was not a full client build/typecheck. The installed local SDK is older than current main; the changed router imports its notification type only, and the focused routing tests use synthetic notifications.

The real restricted sender tests capture serialized upload envelopes and verify independent engine pairs with different headers, preserved SDK conversation identity, and disabled/misclassified-event suppression. Prior synthetic loopback HTTP validation also exercised the router and sender, but predates this main merge. No customer content, production telemetry endpoint, or live CTS ingestion was used.

Do not substitute an SDK model-call ID when an engine snapshot lacks its independently generated pairing UUID. Exercise restricted routing and the sender boundary without inventing missing correlation.

Co-authored-by: Copilot <[email protected]>
Copilot AI balanced review requested due to automatic review settings October 30, 2026 17:47

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 change separating engine snapshot pairing IDs from SDK model-call IDs.

No open issues 🎉

What changed in this PR

This PR preserves the distinction between engine snapshot pairing IDs and SDK model-call IDs in Agent Host telemetry. It addresses namespace safety without changing conversation ownership or downstream ingestion.

Changes:

  • Prevents SDK ID fallback for engine.messages and engine.messages.length, while preserving fallback for other events.
  • Adds regression coverage for missing pairing IDs and independent input/output pairs passed through the restricted sender.
File Description
src/​vs/​platform/​agentHost/​test/​node/​agentHostGitHubTelemetryRouter.test.ts Tests missing pairing IDs, preserved call pairs, and restricted-event filtering.
src/​vs/​platform/​agentHost/​node/​agentHostGitHubTelemetryRouter.ts Excludes engine snapshot events from SDK model-call ID fallback.

Review effort: Balanced

Preserve the engine pairing-ID safeguard alongside the merged SDK conversation identifiers. Remove the obsolete host-context fixture and retain scoped input/output and consent assertions.

Co-authored-by: Copilot <[email protected]>
@amunger
Aaron Munger (amunger) marked this pull request as ready for review November 3, 2026 19:11

@connor4312 Connor Peet (connor4312) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Reviewed for security and correctness; no actionable P1 or P2 findings. No builds or tests run.

Written by Connor's agent running GPT-6.1 Sol

@amunger
Aaron Munger (amunger) merged commit db4fac5 into main Nov 3, 2026
57 checks passed
@amunger
Aaron Munger (amunger) deleted the agents/investigate-and-implement-a-solution-that-satisf branch November 3, 2026 22:23
@vs-code-engineering vs-code-engineering Bot added this to the 1.146.0 milestone Nov 3, 2026
Aaron Munger (amunger) added a commit that referenced this pull request Nov 5, 2026
agentHost: preserve the engine snapshot pairing ID namespace (#345229)

Do not substitute an SDK model-call ID when an engine snapshot lacks its independently generated pairing UUID. Exercise restricted routing and the sender boundary without inventing missing correlation.

Co-authored-by: Copilot <[email protected]>
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.

4 participants