Commit 94ab134
Copilot CLI
feat(telemetry): add diagnostic fields, GDPR annotations, and InvocationGuard infra
Telemetry contract changes to unblock per-tool quality analysis (driven by the 9-query deep-dive in debugagent/06-深度诊断-PR定向-2026-06-09.md):
1. GDPR annotation blocks (the root cause of PR #1644 fields being filtered)
- Added /* __GDPR__ ... */ blocks above the three sanitizedSend call sites
(recordToolInvocation, recordChatActivation, recordLaunchInternal) so the
ddtelfiltered cluster keeps new Properties keys instead of stripping them.
2. Five new enums to replace stringly-typed fields:
- OperatingSystem: win | mac | linux | other
- ClassNameDetectionStrategy: mavenStandard | gradleStandard | vscodeSrc | workspaceRoot
- ClassNameDetectionFailure: sourceDirMissing | fileNotFound | parseError | noPackageDeclaration
- SentinelOutcome: recorded | silentReturn | cancelled | exception
3. ToolInvocationRecord extended with platform/version context:
- os, javaMajorVersion, projectSystem, retryCount, previousOutcome
These split the per-tool funnel by OS / Java major / project system so we can
confirm the Linux 4.3 percent vs Windows 27.7 percent start-rate divergence.
4. LaunchInternalEvent union extended with four new sentinel variants and elapsedMs/thresholdMs:
- debugSession.sentinel: emitted on EVERY invoke so even infinite hangs leave a trail
- debugSession.silentReturn: invoke returned with no outcome event (the 32.8 percent gap)
- debugSession.cancelled: user cancelled mid-flight
- debugSession.exception: handler threw an exception, classified
- classNameDetection.failed: replaces collapsed boolean with strategy + failureReason
- debugSessionStarted/Timeout now carry elapsedMs + thresholdMs for histograms
5. InvocationGuard infrastructure (beginDebugSessionInvocation()):
- Returns markOutcomeRecorded / markException / close methods
- Emits sentinel at begin; close auto-emits silentReturn if no outcome recorded
- Lets us measure the 32.8 percent silent-loss bucket with closed-loop attribution
6. SessionInvocationTracker (nextAttempt / completeAttempt):
- Per-window, per-tool in-memory retry counter
- Stores ONLY enum (previousOutcome) and integer (count) — no user data
- Quantifies the LM auto-retry-pays-off pattern (17.7 percent at 1 -> 64.9 percent at 6-10)
Compiles clean (tsc --noEmit) and passes tslint.1 parent 9df1acb commit 94ab134
1 file changed
Lines changed: 344 additions & 4 deletions
0 commit comments