Summary
Add support for ingesting Pi Coding Agent session artifacts as an agent rollout seed source.
Pi sessions are tree-structured JSONL files stored at ~/.pi/agent/sessions/. The handler resolves the active conversation path by walking from the last entry back to the root via id/parentId links, then normalizes all message types into the shared rollout schema.
Key design points
- Tree-structured sessions — Pi is the first format with in-place branching; the handler resolves the active path automatically
- Entry-level types —
model_change, compaction, branch_summary, custom_message, and thinking_level_change are handled alongside message entries
- Message roles —
user, assistant (with inline ToolCall/ThinkingContent/TextContent blocks), toolResult, bashExecution (synthesized as tool-call pairs), custom, compactionSummary, branchSummary
- Shared utility — extracted
normalize_message_content to utils.py (was duplicated in Hermes handler)
Format reference
Summary
Add support for ingesting Pi Coding Agent session artifacts as an agent rollout seed source.
Pi sessions are tree-structured JSONL files stored at
~/.pi/agent/sessions/. The handler resolves the active conversation path by walking from the last entry back to the root viaid/parentIdlinks, then normalizes all message types into the shared rollout schema.Key design points
model_change,compaction,branch_summary,custom_message, andthinking_level_changeare handled alongsidemessageentriesuser,assistant(with inlineToolCall/ThinkingContent/TextContentblocks),toolResult,bashExecution(synthesized as tool-call pairs),custom,compactionSummary,branchSummarynormalize_message_contenttoutils.py(was duplicated in Hermes handler)Format reference