-
Notifications
You must be signed in to change notification settings - Fork 0
Add Pi code agent integration #161
Description
Summary
Add support for capturing sessions from Pi code, an AI coding agent, so Partio can checkpoint Pi-driven commits alongside Claude Code ones.
Inspired by entireio/cli#811.
What to implement
Add a Pi code agent detector in internal/agent/ following the existing Claude Code pattern:
- Detect a running Pi process via process list scan (look for
piorpi-monobinary) - Locate Pi session/transcript files (research
~/.pi/or similar per Pi's docs) - Parse Pi transcript format into
SessionDatafields:Prompt,Context,TokensUsed - Register the detector so
partio enable --agent piinstalls the appropriate hooks
The implementation should follow the same Detector interface defined in internal/agent/detector.go and mirror the structure of internal/agent/claude/.
Why
Pi is an actively developed AI coding agent. Users running Pi to write code should be able to capture those sessions in Partio just like Claude Code sessions. Without this, Pi users get no checkpoint trailers and lose the AI reasoning history for their commits.
User Relevance
Pi users who adopt Partio expect it to work with their toolchain. Missing agent support means silent failures — hooks run, commits complete, but no checkpoint is linked and no session is preserved. Supporting Pi makes Partio usable for a broader set of AI-assisted development workflows.
Target Repos
cli
Context Hints
internal/agent/— Detector interface and agent package structureinternal/agent/claude/— Reference implementation to mirrorcmd/partio/enable.go— Where agent flag is parsed and hooks installed
Acceptance Criteria
-
partio enable --agent pisucceeds and installs hooks -
partio statusshows the Pi agent as configured - Pre-commit hook detects a running Pi process and saves state
- Post-commit hook reads Pi session data and creates a checkpoint
- Table-driven tests cover process detection and transcript parsing
- If Pi is not running, Partio falls back gracefully (no checkpoint, no error)