Expand description
Serde models for the GitHub Copilot CLI events.jsonl session format.
Current Copilot CLI writes ~/.copilot/session-state/<sessionId>/events.jsonl
where every line is a single event carrying its own type discriminator.
The analyzer walks these events in order and pulls session metadata from
session.start, model switches from session.model_change, tool calls
from the tool.execution_start / tool.execution_complete pair, and
authoritative per-model token usage from session.shutdown.modelMetrics.
Earlier Copilot CLI releases wrote a single pretty-printed JSON object
under ~/.copilot/history-session-state/<sessionId>.json with no token
accounting at all; that layout is no longer supported.
Structs§
- Copilot
Event - Single line of the Copilot
events.jsonlstream. - Copilot
Model Change Data session.model_changepayload — each session may switch between models at any point, so the analyzer uses the most recent one when attributing streamingassistant.messagetokens that arrive beforesession.shutdown.- Copilot
Model Metric - Per-model block inside
CopilotShutdownData::model_metrics. - Copilot
Model Usage - Token counts captured by Copilot CLI at session shutdown.
- Copilot
Session Context - Workspace context recorded at the start of a Copilot CLI session.
- Copilot
Session Start Data session.startpayload — session-scoped identifiers and workspace context.- Copilot
Shutdown Data session.shutdownpayload — authoritative per-model token usage.- Copilot
Tool Complete Data tool.execution_completepayload — carries the tool’s actual output (file contents onview, creation confirmation oncreate, …) underresult, plus the model that invoked the tool.- Copilot
Tool Start Data tool.execution_startpayload — paired withtool.execution_completeviatool_call_id.