MapToEnrollmentEvent was returning the composite PartitionKey ({TenantId}_{SessionId})
as TenantId instead of extracting the actual tenant ID. Now prefers the stored TenantId
property with fallback extraction from the composite key.
Also adds a Vitest-based integration test suite (39 tests) covering all MCP tool endpoints:
- Session tools (search, get, events, analysis, CVE, blocked devices)
- Admin tools (metrics, geographic, platform, usage, audit, ops, reports)
- Raw data tools (tables, raw sessions/events, backend logs)
- Read-only verification (PUT/DELETE rejection)
- Error handling (404, 400, empty results)
Run with: AUTOPILOT_API_TOKEN="eyJ..." npm test
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
GetSessionEventsFunction, GetRuleResultsFunction, and GetVulnerabilityReportFunction
were missing the FindSessionTenantIdAsync fallback that GetSessionFunction already had.
When a Global Admin queried a cross-tenant session without explicit tenantId, the
middleware defaulted to the JWT tenant, causing partition key mismatch and empty results.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
First 3 attempts use default desktop (""), then alternate with explicit
"WinSta0\Default" to handle post-Hello desktop access issues. Log tags
[default desktop]/[explicit desktop] for traceability.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
.* doesn't match newlines without Singleline flag — script stdout/stderr
from AgentExecutor.log spans multiple lines and was never captured.
Changed to [\s\S]*? to match across newlines.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Register global/ops-events GET endpoint in EndpointAccessPolicyCatalog
as GlobalAdminOnly (critical fix: was fail-closed for all users)
- Add get_ops_events MCP tool for AI agent access to ops events
with category filter and maxResults params
- Add blob storage health check in daily maintenance that verifies
agent ZIP and bootstrap script availability via HEAD requests,
records OpsEvent entries when missing or unreachable
- Add RecordBlobStorageMissing/Unreachable helpers to OpsEventService
https://claude.ai/code/session_01UCFrxsZ8QYjH7KEYmiGJ6c