Repository navigation
Copilot Historical Evidence Repair
Copilot → Copilot Historical Evidence Repair
Released in 1854 through PR #756, with isolated replay staging in #765. This is optional maintenance, not a mandatory upgrade repair. Synthetic SQL/API tests do not establish a successful deployed repair, an accepted final command-line operation or a Power BI Desktop refresh; #639/#699 remain open acceptance work.
repair_historical_copilot_evidence.sql is a standalone bounded repair, not an EF migration. It is attached only to the Stable 1854 release and is unchanged in later releases. It classifies up to 1,000 provable stored agent identities and restores up to 50,000 unsupported reason-2 mappings per run, with no schema change and no credit-total calculation. The importer runs the same script in every import cycle, so running it by hand only speeds that up. If you do, use that release asset under an approved maintenance plan. It neither replaces the replay below nor belongs in __MigrationHistory.
The replay reads only retained audit_events.event_data into the existing importer/merge path. It makes no Graph calls and adds no schema migration. It cannot recover original top-level AgentId, AppIdentity or AgentPlatform fields that were discarded, missing response counts, deleted DLP evidence or conversation identifiers never retained. An inventory label, bare GUID, thread id or nearby timestamp is not a substitute.
For credits, only supported retained evidence proving a positive custom-engine estimate can repair a recognised old zero without AgentCreditBasis. Nonzero, current, future, unsupported and ambiguous estimates stay untouched. Replay counts are not credit-recovery counts; unknown and unrecoverable outcomes must remain visible. Customer-built/Microsoft/Unknown origin remains separate from billing kind, and a legacy stored false flag does not prove Microsoft origin.
For turns, 1854 removes same-host ten-second suppression and restores unsupported reason-2 mappings without deleting chats or moving resources. Genuine rapid prompts remain separate; some actual same-host repeats may remain counted because timing cannot distinguish them. Retained conversation evidence can seed cross-host pairing, but repair accepts mutually unique candidates only. Overlapping candidates stay unpaired; resources unique to either constituent remain attributed to the counted turn.
The opt-in command processes one bounded batch per invocation, over an explicit UTC half-open window: start included, end excluded. Limits are 500 chats, 1 MiB per retained payload and 8 MiB buffered retained text. SQL uses DATALENGTH; the buffer counts UTF-16 code units at two bytes each. These are text limits, not total process-memory limits. Unsupported/invalid/oversized payloads are skipped, not guessed. For example, after creating an approved private checkpoint directory:
# Synthetic dates and path: replace only in your private operating environment.
.\SPOInsights.WebJob.Office365ActivityImport.exe --repair-copilot-history `
'2000-01-01T00:00:00Z' '2000-02-01T00:00:00Z' `
'C:\Private\Contoso\copilot-history.json'Use the importer's approved runtime configuration. This command writes to the configured database, not a read-only diagnostic. Run it only after target-specific acceptance and maintenance approval. Checkpoint preflight rejects Git worktrees (including ignored/linked locations) and reparse points before target access; use a real private directory. 1854 gives replay unique temporary staging-table names, isolating it from live-import staging; this does not remove SQL contention or establish a live-import impact envelope.
Repeat with the same target, window and checkpoint to resume, until an invocation reports Scanned=0. The checkpoint records every timestamp/user/event ordering component, is target/window-bound and exclusively locked, and is published atomically only after a successful batch. A failed pairing or merge must leave the successful checkpoint unchanged. The state contains internal record/user identifiers: keep it private, outside Git, and never paste it into an issue, screenshot or documentation.
Global origin and reason-2 repairs are separate bounded normal-import self-healing operations. Repeating the replay command does not globally drain those repairs; it revisits only selected and nearby records. A completed replay checkpoint must not be reported as proof that all three repair paths have completed.
An ascending checkpoint can miss historical inserts or repairs made behind it while it runs. After such writers settle, perform a new complete pass with a new checkpoint over the same window; one completed pass is not proof that all history was recoverable. Monitor plans, reads and elapsed time at large-tenant scale, use an approved maintenance window, and do not treat bounded writes as a performance benchmark.
The matching released Power BI template changes distinguish missing estimates from zero or billed consumption, preserve positive legacy estimates with provenance, show tri-state origin, exclude maker testing and count paired turns once. Weekly profiling preserves constituent resource metadata. Updating a procedure does not rewrite compiled weeks: explicitly recompile affected weeks, then refresh and visually verify the intended template. Final desktop/operational acceptance remains outstanding. This does not revive the deprecated adoption-specific PBI version.
Return to Copilot · All topics in this guide
Previous: Copilot Agent Evidence · Next: Copilot Reports and Prompt History
- Copilot analytics overview
- Copilot Adoption user guide
- Copilot Adoption setup (admins)
- Work Trend Index
- Copilot investment
- Copilot spend
- Agent costs
- Prompt categories
- Copilot credit history (preview)
- Agent 365 package catalog
- The Copilot data in depth
- Prerequisites
- App registrations setup
- Install with the installer
- Verify the deployment
- Security & permissions model
- Private endpoints (optional)
- Certificate authentication (optional)
- Manual installation
- Activity & usage analytics (Power BI)
- SharePoint page tracking