Conversation
Add support for standalone pi-agent sessions stored in ~/.pi/agent/sessions/. This complements the existing 'pi' adapter which handles openclaw-embedded pi. Key differences from openclaw pi: - Per-project directory structure (like Claude Code) - Path encoding: /path/to/project → --path-to-project-- - Project-specific watch scope (not global) Implementation: - Reuses pi package types (same JSONL format) - Full message parsing with tool result linking - Incremental parsing for append-only growth - Session categorization (interactive, cron, system) Identity: pi-agent / Pi Agent / π
- Add AgentPi constant and entries in all agent maps (types.go)
- Add detectPiSessionStatus for session file detection (agent_session.go)
- Pi stores sessions in ~/.pi/agent/sessions/--{path}--/*.jsonl
- Update README.md and website docs with Pi Agent support
- Add AgentPi to TestGetAgentCommand, TestShouldShowSkipPermissions, and TestBuildAgentCommand tables - Add TestDetectPiSessionStatus_* tests for session file detection
|
Your changes are working great in my testing. One small addition that would enable the resume feature from the conversations plugin:
case "pi-agent", "pi":
return fmt.Sprintf("pi --session %s", session.ID)
case "pi-agent", "pi":
agentType = workspace.AgentPiWithout these, pressing resume on a pi session shows "Resume not supported for Pi Agent". Example of this in my fork: boozedog@4d41eb4 |
|
Hey @gregzuro — this looks great, thanks for putting it together! We already have the One thing before we merge: @boozedog flagged that resume support is missing for Pi sessions (see their comment on PR #155). Would you mind folding in those two small additions? // internal/plugins/conversations/view_content.go — resumeCommand()
case "pi-agent", "pi":
return fmt.Sprintf("pi --session %s", session.ID)
// internal/plugins/conversations/resume_modal.go — defaultAgentIdxForAdapter()
case "pi-agent", "pi":
agentType = workspace.AgentPiThat way both adapters get resume support in one shot. Once that's in, we're good to merge. 🪶 |
Sure will. JAS. |
- Map pi-agent and pi adapter IDs to AgentPi in resume modal - Add resume command format for pi sessions (pi --session <id>) - Fix minor whitespace alignment in renderSourceLabel
|
Added. Ready to go. Thanks @boozedog |
|
Thanks @gregzuro! 🎉 This is shipped in v0.74.0. Great work on the Pi Agent adapter — clean implementation that follows all the existing patterns perfectly. |
This adds the plain-old pi-agent as an adapter (conversations) and as an agent (workspaces).
Since pi-agent works differently in its stand-alone release as compared to the openclaw one, it seemed like a separate implementation was in order.
For conversations, this is basically the pi (openclaw) version melded with session handling a la Claude Code.
All the adapter patterns were followed, tests and doc updated.
I've live-exercised it a bit, but would appreciate some input from someone with more sidecar experience.
-G