Add pi.dev agent integration#15
Conversation
- Add command to install pi.dev extension
- Extension captures bash commands via event
- Extension captures prompts via event
- Records commands with executor=pi and correct exit codes
- Prompts cached to ~/.local/share/suvadu/prompts/pi-{session}.prompt
- Follows same patterns as OpenCode integration
MadhuAppachi
left a comment
There was a problem hiding this comment.
Thanks for the quick PR! This follows the existing integration patterns nicely.
A few things I'd like to clarify before merging:
- Pi.dev API stability — How stable is the
ExtensionAPIfrom@mariozechner/pi-coding-agent? Since Pi is relatively new, any breaking changes there would break this extension. - Session ID —
base.slice(0, 12)could collide if session filenames share a common prefix. Would using the full basename be safer? _ctx.cwd— Does this always reflect the working directory where the bash command runs, or is it the initial launch directory?
Also, could you retarget this PR to the dev branch? We're planning the 0.3.1 release within the next 48 hours, and this will be part of it.
Happy to iterate on these — nice work getting this in so quickly!
|
I'll look into 1. and 3. tomorrow. Do you have a recommendation for 2.? |
- Use ctx.sessionManager.getSessionId() for proper session UUID - Fallback extracts UUID from filename pattern (timestamp_uuid.jsonl) - No longer truncates to 12 chars which was just cutting up a date
|
The parts used from
Your call :D |
|
Thanks for digging into all of this! The API surface is small enough ( |
|
Cool, looking forward to it, and what else you come up with :) |
|
Hi @MadhuAppachi pi has added See CHANGELOG |


Summary
Adds support for tracking commands executed by the pi.dev coding agent. Implements #14
Changes
suv init picommand to install pi.dev extensiontool_resulteventbefore_agent_starteventexecutor=piand correct exit codes~/.local/share/suvadu/prompts/pi-{session}.promptUsage
Creates
~/.pi/agent/extensions/suvadu.tswhich auto-loads when pi.dev starts.How It Works
before_agent_starttool_calltool_resultsuv addExit Code Handling
isError: false) → exit code 0isError: true) → tries to extract exit code from details, defaults to 1Testing
Tested manually with pi.dev:
Follows the same patterns as the OpenCode integration.