Skip to content

Agent Host: emit restricted repository info telemetry#326424

Draft
zhichli wants to merge 1 commit into
mainfrom
zhichli/restr5th-v2
Draft

Agent Host: emit restricted repository info telemetry#326424
zhichli wants to merge 1 commit into
mainfrom
zhichli/restr5th-v2

Conversation

@zhichli

@zhichli zhichli commented Jul 18, 2026

Copy link
Copy Markdown
Member

Implements repository-info telemetry parity for Copilot SDK sessions in Agent Host.

  • Captures immutable repository snapshots at root turn start/end, including committed, working-tree, renamed, deleted, and untracked changes.
  • Emits the legacy request.repoInfo schema to enhanced GitHub and internal Microsoft telemetry with the existing safety, size, multiplexing, and debug-disable behavior.
  • Binds collection and delivery to the session token context; suppresses source diffs when content exclusion may apply and drops stale-account or changing-tree captures.
  • Supports GitHub, GitHub Enterprise, and Azure DevOps remotes.

Validation:

  • npm run typecheck-client
  • npm run valid-layers-check
  • Agent Host repo-info lifecycle, collector/reporter, and config-forwarding unit tests
  • Real-Git immutable snapshot integration test
  • VS Code hygiene checks

Refs microsoft/vscode-internalbacklog#8247

Copilot AI review requested due to automatic review settings July 18, 2026 04:30

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.

Pull request overview

Adds restricted repository-information telemetry for Copilot SDK sessions in Agent Host.

Changes:

  • Captures immutable Git snapshots at root-turn boundaries.
  • Routes legacy-compatible telemetry with account, exclusion, and size safeguards.
  • Adds Git helpers, configuration forwarding, and lifecycle coverage.
Show a summary per file
File Description
src/vs/platform/agentHost/test/node/shared/copilotApiService.test.ts Tests exclusion discovery.
src/vs/platform/agentHost/test/node/copilotGitProject.test.ts Updates Git mock.
src/vs/platform/agentHost/test/node/copilotAgentSession.test.ts Tests telemetry lifecycle.
src/vs/platform/agentHost/test/node/copilotAgent.test.ts Updates Git mock.
src/vs/platform/agentHost/test/node/agentService.test.ts Updates Git mocks.
src/vs/platform/agentHost/test/node/agentHostTelemetryReporter.test.ts Tests telemetry routing.
src/vs/platform/agentHost/test/node/agentHostRepoInfoTelemetry.test.ts Tests collection and safeguards.
src/vs/platform/agentHost/test/node/agentHostPullRequestOperationHandler.test.ts Updates Git mock.
src/vs/platform/agentHost/test/node/agentHostGitService.test.ts Tests remote ordering.
src/vs/platform/agentHost/test/node/agentHostGitService.integrationTest.ts Tests immutable snapshots.
src/vs/platform/agentHost/test/node/agentHostDiscardChangesOperationHandler.test.ts Updates Git mock.
src/vs/platform/agentHost/test/node/agentHostCommitOperationHandler.test.ts Updates Git mock.
src/vs/platform/agentHost/test/electron-browser/remoteAgentHostProtocolClient.test.ts Tests debug-setting forwarding.
src/vs/platform/agentHost/test/common/sessionTestHelpers.ts Extends no-op Git service.
src/vs/platform/agentHost/node/shared/copilotApiService.ts Discovers exclusion state.
src/vs/platform/agentHost/node/copilot/copilotAgentSession.ts Integrates turn lifecycle capture.
src/vs/platform/agentHost/node/copilot/copilotAgent.ts Supplies token-current validation.
src/vs/platform/agentHost/node/agentHostTelemetryReporter.ts Emits legacy telemetry schema.
src/vs/platform/agentHost/node/agentHostRestrictedTelemetry.ts Extends immutable context.
src/vs/platform/agentHost/node/agentHostRepoInfoTelemetry.ts Implements repository collection.
src/vs/platform/agentHost/node/agentHostGitService.ts Adds snapshot and diff helpers.
src/vs/platform/agentHost/electron-browser/localAgentHostService.ts Forwards local debug setting.
src/vs/platform/agentHost/common/agentHostSchema.ts Defines root configuration key.
src/vs/platform/agentHost/common/agentHostGitService.ts Extends Git service API.
src/vs/platform/agentHost/browser/remoteAgentHostProtocolClient.ts Forwards remote debug setting.

Review details

  • Files reviewed: 25/25 changed files
  • Comments generated: 2
  • Review effort level: Medium

Comment thread src/vs/platform/agentHost/node/copilot/copilotAgentSession.ts
Comment thread src/vs/platform/agentHost/node/agentHostRepoInfoTelemetry.ts Outdated
Capture immutable begin/end repository snapshots for root Copilot turns and
emit the legacy request.repoInfo schema to enhanced GitHub and internal
Microsoft telemetry. Reuse Agent Host Git baselines and tree snapshots so
committed, working-tree, rename, delete, and untracked changes are represented
without mutating the user's index.

Bind every event to the session launch token's immutable telemetry context,
suppress source diffs when content exclusion may be enabled, and detect account,
abort, and mid-capture tree changes before sending. Match the legacy safety and
payload limits, multiplex large diffs, support GitHub/GHE/Azure DevOps remotes,
and forward the existing repo-info debug kill switch into Agent Host config.

Refs microsoft/vscode-internalbacklog#8247
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.

2 participants