Skip to content

refactor(pi-coding-agent): migrate from CLI subprocess to SDK#729

Merged
christso merged 1 commit intomainfrom
refactor/704-pi-coding-agent-sdk-migration
Mar 24, 2026
Merged

refactor(pi-coding-agent): migrate from CLI subprocess to SDK#729
christso merged 1 commit intomainfrom
refactor/704-pi-coding-agent-sdk-migration

Conversation

@christso
Copy link
Copy Markdown
Collaborator

@christso christso commented Mar 24, 2026

Summary

  • pi-coding-agent provider: rewrites from CLI subprocess to SDK (createAgentSession + session.subscribe)
  • pi-cli provider: new subprocess provider for users who prefer the CLI binary (executable field, defaults to pi on PATH)
  • @mariozechner/pi-coding-agent is now an optional peer dependency with auto-install prompt on first use
  • Removes deprecated pi-agent-sdk provider entirely
  • Drops executable field from pi-coding-agent config (not needed with SDK)

Breaking: pi-coding-agent targets using executable must remove the field or switch to provider: pi-cli.

Closes #704

Test plan

  • Build, typecheck, lint all pass
  • All 306 tests pass
  • Example YAML validation passes
  • Manual e2e: run a pi-coding-agent eval to verify SDK integration
  • Manual e2e: run a pi-cli eval to verify subprocess approach

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages bot commented Mar 24, 2026

Deploying agentv with  Cloudflare Pages  Cloudflare Pages

Latest commit: c56f87c
Status: ✅  Deploy successful!
Preview URL: https://7e23c2f0.agentv.pages.dev
Branch Preview URL: https://refactor-704-pi-coding-agent.agentv.pages.dev

View logs

@christso christso force-pushed the refactor/704-pi-coding-agent-sdk-migration branch from 51e7570 to f09ca7e Compare March 24, 2026 04:21
Replace the Pi CLI subprocess spawning with direct calls to
@mariozechner/pi-coding-agent SDK's createAgentSession API.
Remove the deprecated pi-agent-sdk provider entirely.

Key changes:
- pi-coding-agent provider: uses SDK directly (createAgentSession + session.subscribe)
- pi-cli provider: new subprocess provider for users who prefer the CLI binary
- @mariozechner/pi-coding-agent is now an optional peer dependency with auto-install
  prompt on first use (interactive TTY only)
- Remove pi-agent-sdk provider, config types, and registry entries
- Drop executable field from pi-coding-agent (not needed with SDK)
- Map config apiKey to provider-specific env vars for SDK consumption

Closes #704

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@christso christso force-pushed the refactor/704-pi-coding-agent-sdk-migration branch from f09ca7e to c56f87c Compare March 24, 2026 04:26
@christso christso merged commit 8df3761 into main Mar 24, 2026
1 check passed
@christso christso deleted the refactor/704-pi-coding-agent-sdk-migration branch March 24, 2026 04:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

refactor(pi-coding-agent): migrate from CLI subprocess to @mariozechner/pi-coding-agent SDK

1 participant