PI RPC
glib starts PI as a subprocess:
pi --mode rpc --cwd <repo>Communication is newline-delimited JSON (JSONL) over stdin/stdout.
Commands sent to PI
Section titled “Commands sent to PI”promptabortsteernew_sessionget_stateset_model
Events received from PI
Section titled “Events received from PI”agent_starttext_deltatool_execution_starttool_execution_updatetool_execution_endagent_endauto_compaction_startauto_compaction_endauto_retry_startauto_retry_endextension_ui_request
Lifecycle model
Section titled “Lifecycle model”- One PI process per repo session.
- Process is killed on repo change or app quit.
- Single stdout reader goroutine handles framing.
- Each message is delimited by
\nand parsed as strict JSONL.