Track MCP tool invocations in App Insights and UserUsageLog:
- Add ClientSource + McpToolName custom dimensions to RequestTelemetry
- Propagate tool name via X-MCP-Tool-Name header from MCP server
- Wrap all 26 tool handlers with withToolTelemetry for context propagation
- Add MCP_TOOL_LOGGING env var (default false) for optional stderr logging
- Add toolLoggingEnabled param to Bicep template for persistence
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Gate WelcomeMessage on !loading so it only appears when sessions are
truly empty, not while the initial fetch is still in progress.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
When search is active with <8 local results, automatically loads all
remaining sessions progressively (batch by batch) so the local search
can find matches across ALL fields (country, city, model, etc.).
Bottom button shows "Search all sessions..." with progress spinner
when search is active, keeps "Load 100 more..." for manual browsing.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Part 5 of 5 in Monitoring/ bounded-context restructure. StallProbeCollector
lands in Enrollment/SystemSignals/. Empty Core/Tracking/Collectors/Network/
Analyzers/Flows/Replay/ directories removed. No behavior change.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Part 3 of 5 in Monitoring/ bounded-context restructure. Split by purpose
(periodic metrics, hardcoded analyzers, backend-driven gather rules,
device info). Pure folder move + namespace update; no behavior change.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Part 2 of 5 in Monitoring/ bounded-context restructure. Network/* plus
Core/EventSpool + Core/EventUploadOrchestrator moved into Monitoring/Transport/.
Pure folder move + namespace update; no behavior change.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Part 1 of 5 in Monitoring/ bounded-context restructure. Moves Monitoring/Core/*
(minus EventSpool/EventUploadOrchestrator/DeviceInfoProvider/EnrollmentCompletionHandler
which belong to later PRs) into Monitoring/Runtime/. Interop/ stays on
Monitoring root. Pure folder move + namespace update; no behavior change.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The shadow validator previously awaited the Graph round-trip inline,
adding 200ms-30s of latency to every RegisterSession/Ingest response
on opted-in tenants — defeating the "shadow, never blocks" intent.
Detach the lookup as Task.Run with captured locals so the agent gets
its OK immediately. Result is logged at Warning level (Information
gets filtered by sampling/log-level config and never surfaced).
Drop the now-unused EnrichRequestTelemetryWithDeviceAssociation method
and its tests — Activity.AddTag from a detached task wouldn't make it
into the request telemetry anyway, since the parent activity has
already stopped by the time the background lookup completes.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The DevPrep shadow validator was never executed because the
ValidateSecurityAsync extension constructed SecurityValidator without
passing DeviceAssociationValidator, so _deviceAssociationValidator was
always null and the gate at SecurityValidator.cs:370 silently skipped
the lookup — even with ValidateDeviceAssociation=true on the tenant.
Inject the validator via DI into all 9 agent-facing functions
(RegisterSession, IngestEvents, GetAgentConfig, ReportAgentError,
GetDiagnosticsUploadUrl + 4 Bootstrap variants) and thread it through
the extension to SecurityValidator.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Moves WHfB policy detection, UDR event handling (300/301/358/360/362/376),
HelloForBusiness watcher (3024/6045), Hello wait/completion timers and
HelloOutcome state machine into a dedicated HelloTracker class (820 LOC).
Cross-boundary with ESP (Shell-Core 62404/62407) is narrowed to two
explicit notify methods: NotifyHelloWizardStarted + NotifyEspExited.
Public API of EspAndHelloTracker is unchanged — IsPolicyConfigured,
IsHelloCompleted, HelloOutcome, StartHelloWaitTimer, ForceMarkHelloCompleted,
ResetForEspResumption and the HelloCompleted event now delegate to the
composed HelloTracker. CollectorCoordinator + EnrollmentTracker integration
requires no changes.
Adds 29 xUnit tests covering: UDR terminal events, 6045 skip HRESULT,
wait/completion timer paths (policy-enabled extended wait, policy-disabled
immediate completion, wizard-started vs wizard-not-started outcomes),
cross-boundary notifications, ForceMarkHelloCompleted semantics and
ResetForEspResumption state reset.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>