Skip to main content

Module transcript

Module transcript 

Source
Expand description

session.get_transcript’s response shape (#2058).

Why: SessionRegistry::set_run_outcome (#2056) already persists a finished execution’s turn-by-turn transcript, aggregate token usage, and priced cost onto the SessionEntry — this is the M1 cut-line’s “inspect transcript” verb, exposing that stored record over the wire without recomputing anything. Kept as its own small file (rather than growing registry.rs) so the wire shape has one obvious home and stays decoupled from the registry’s storage/locking internals. What: TranscriptRecord is a plain, Serialize+Deserialize DTO (#2060: the Deserialize half lets tcode’s CLI thin client — see crate::cli_client — parse session.get_transcript’s JSON-RPC result straight back into this type rather than picking fields off a raw serde_json::Value): session_id, the ordered turns (each already role/model/text/tool_calls/ usage — see crate::run_task::TurnRecord), the aggregate usage, and cost_usd exactly as stored (None either because pricing was unavailable for the run, or because no run has ever completed on this session — the two cases are indistinguishable here by design, matching RunReport::cost_usd’s existing convention). A session that has never run a task returns turns: [], usage all-zero, cost_usd: null — a valid, empty transcript, not an error. mode (#2059) is the resolved HarnessMode task.run set via SessionRegistry::set_mode — None for the same “never run” case. Test: session::registry_tests::get_transcript_*.

Structs§

TranscriptRecord
The full stored run record for one session, as session.get_transcript returns it.