feat(agents): add pi adapter#138
Conversation
Greptile SummaryThis PR introduces the Pi agent adapter (
Confidence Score: 5/5Safe to merge — the adapter is a clean additive change, all required interface methods are implemented correctly, and the previously reported SystemPromptFile issue has been fixed. The adapter correctly inlines system-prompt file contents rather than forwarding the path, binary resolution is cached safely under a mutex, context cancellation is propagated through every public method, and the wiring test confirms end-to-end resolver coverage. No pre-existing functionality is altered. No files require special attention. Important Files Changed
Sequence DiagramsequenceDiagram
participant AO as AO Spawn Engine
participant Plugin as pi.Plugin
participant FS as Filesystem
participant Pi as pi binary
AO->>Plugin: GetLaunchCommand(ctx, LaunchConfig)
Plugin->>Plugin: "piBinary(ctx) — resolve & cache"
alt SystemPromptFile set
Plugin->>FS: os.ReadFile(cfg.SystemPromptFile)
FS-->>Plugin: []byte contents
end
Plugin-->>AO: "["pi","--print","--append-system-prompt","<text>","<prompt>"]"
AO->>Pi: exec(cmd)
AO->>Plugin: GetRestoreCommand(ctx, RestoreConfig)
Plugin->>Plugin: read MetadataKeyAgentSessionID from session metadata
alt agentSessionID known
Plugin-->>AO: "["pi","--print","--session","<uuid>"], ok=true"
AO->>Pi: exec(restore cmd)
else no agentSessionID
Plugin-->>AO: "nil, ok=false"
AO->>AO: fall back to fresh launch
end
Reviews (2): Last reviewed commit: "feat(agents): add pi adapter" | Re-trigger Greptile |
Registers the pi harness, stacked on the agent platform. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Adds the pi harness, stacked on #119 (agent platform). Adapter package +
Constructors()registration + resolver test.🤖 Generated with Claude Code
Stack