feat: add Pi CLI adapter for multi-provider LLM support#58
Closed
charles-cooper wants to merge 1 commit intoevmts:mainfrom
Closed
feat: add Pi CLI adapter for multi-provider LLM support#58charles-cooper wants to merge 1 commit intoevmts:mainfrom
charles-cooper wants to merge 1 commit intoevmts:mainfrom
Conversation
- Add <Pi> component that spawns pi --mode json - PiStreamParser handles JSON events with block lifecycle - Error handling for auth, missing CLI, rate limits - Unit tests for arg-builder, errors, stream parser
Contributor
|
Pi support added #72 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
<Pi>component that spawnspi --mode jsonto execute agents, giving Smithers multi-provider LLM support via the pi CLI.Changes
<Pi provider="anthropic" model="sonnet">prompt</Pi>Usage
Design
executeCLIinfrastructureBaseStreamParserfor consistent patternsTesting
bun test src/components/agents/pi-cli/ src/streaming/pi-parser.test.tsPROMPT
PR #58: Pi CLI Adapter - Session Transcript
Overview
This document captures the user prompts, design discussions, and decisions that led to the Pi CLI adapter implementation.
User Prompts (Chronological)
1. Initial Request
2. Understanding Current Architecture
3. Challenging the Proposed Approach
4. Critical Design Constraint
5. Validation Request
6. Implementation Kickoff
7. Iteration Style
8. Specific Agent Assignment
9. Final Tasks
Design Discussion
Initial Proposal (Model-Generated)
Two integration options were proposed:
@mariozechner/pi-agentand make direct LLM callspi --mode jsonas subprocessInitial model recommendation leaned toward Direct API for:
User Challenge
The user questioned whether startup overhead was the only meaningful difference, prompting a deeper analysis via three review subagents (Opus, Gemini, GPT).
Review Findings (Model-Generated via Subagents)
Opus identified:
proc.kill()vs cooperativeabort()Gemini identified:
GPT identified:
Pivotal User Insight
This reframed the decision from purely technical to architectural/ownership:
Final Decision
CLI spawning is the right answer for a third-party integration:
Implementation Approach
Architecture
Key Design Decisions
Reuse existing infrastructure
executeCLIfrom shared/cli-executor.tsBaseStreamParserfor consistent patternsEvent mapping
Error handling
PiNotInstalledErrorwith install instructionsPiAuthErrorwith provider contextLimitations accepted for v1
Review Iterations
The implementation went through 6 review rounds with fix iterations:
Final Deliverable
a44827c