Skip to main content

read_grok_transcript

Function read_grok_transcript 

Source
pub fn read_grok_transcript(session_path: &Path) -> Result<GrokTranscript>
Expand description

Project a Grok Build session directory. chat_history.jsonl is the conversation of record: one JSON object per line, internally tagged by type.

  • system — the rendered system prompt; not conversation.
  • usercontent is a list of {type: "text"|"image", ...} parts. A synthetic_reason marks a message the runtime injected rather than one a person typed.
  • assistantcontent is the response text, with any tool_calls as {id, name, arguments} beside it.
  • reasoning — an inlined Responses-API reasoning item whose summary holds {type: "summary_text", text} parts.
  • tool_result{tool_call_id, content}.

Compaction rewrites the file in place, so a compaction_meta message with no earlier real prompt means the raw history is already gone.