Skip to content
Source
Sign inSign up
pingdotgg/t3code

feat: add Pi provider integration via RPC #4355

Closedoussamadouhou(GitHub profile, opens in a new tab)wants to merge 5 commits intomain fromrefs/pull/4355/headopened View on GitHub

What Changed

  • Add Pi as a built-in provider using Pi's native JSONL RPC mode.
  • Add provider health checks, configured-binary support, dynamic model discovery, and provider-native thinking options.
  • Map Pi session, turn, text, reasoning, tool, approval, and user-input events into T3 Code's canonical provider runtime events.
  • Add guarded approval handling, attachments, model switching, rollback/fork behavior, and Pi-backed text generation.
  • Surface Pi in provider settings, provider-instance creation, icons, and model selection.
  • Add focused server, web, and contracts coverage plus provider setup documentation.

This is intentionally Pi-only. Unlike #2748, which combines Hermes and Pi through ACP, this implementation follows the native RPC direction described in #402.

Why

#402 asks for Pi to participate in the existing provider/orchestration model without a Pi-specific frontend path, static fallback models, or unsafe partially initialized sessions. Pi's RPC mode provides the required session and event primitives while keeping Pi-specific behavior inside its driver, provider, adapter, and transport layers.

UI Changes

Verified in an isolated local app:

  • Pi appears in provider settings and the add-provider-instance flow.
  • Enabling Pi discovers the installed runtime and reports authenticated status.
  • Pi exposed 46 dynamically discovered models in the tested environment.
  • The text-generation model picker includes a Pi provider rail and Pi models.

Screenshots or a short recording will be attached before marking this draft ready for review.

Verification

  • pnpm install --frozen-lockfile
  • pnpm exec vp test run against 10 affected test files: 168 tests passed
  • pnpm exec vp run --filter t3 --filter @t3tools/web --filter @t3tools/contracts typecheck
  • Targeted vp lint for changed TypeScript/JavaScript files
  • Targeted vp fmt --check for changed source and documentation files
  • git diff --check origin/main...HEAD
  • Isolated paired-browser verification of Pi settings, discovery, provider-instance selection, and model selection

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes

The implementation is focused to one provider, but it necessarily spans contracts, server runtime, web registration, tests, and documentation. This remains a draft while maintainers advise whether they prefer this as one vertical PR or a staged series.

Note

Add Pi provider integration via RPC with session management, text generation, and approval gating

  • Adds a full Pi provider driver backed by the @earendil-works/pi-coding-agent package, wiring it into the built-in provider registry alongside existing providers.
  • Implements PiRpcClient — a process-spawned JSONL transport with correlated request/response handling, streaming stdout classification, timeout management, and process lifecycle control.
  • Implements PiAdapter for session/turn lifecycle, assistant content and reasoning streaming, tool approval gating via an injected extension (t3-approvals.ts), and user input round-trips.
  • Implements PiTextGeneration for commit messages, PR content, branch names, and thread titles using structured JSON output with schema validation and output sanitization.
  • Adds PiProvider status probing via pi --version and live model discovery via RPC; adds Pi settings schema to contracts and registers the provider in the web UI with an 'Early Access' badge.
  • Risk: Pi models are discovered dynamically at runtime with no static default; missing binary or empty model list degrades to a warning/unknown auth snapshot rather than an error.
📊 Macroscope summarized f8389d5. 20 files reviewed, 0 issues evaluated, 0 issues filtered, 0 comments posted

🗂️ Filtered Issues

No issues evaluated.

    1. coderabbitai[bot](GitHub profile, opens in a new tab)commented

      Important

      Review skipped

      Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

      ⚙️ Run configuration

      Configuration used: Repository UI

      Review profile: CHILL

      Plan: Pro Plus

      Run ID: ec5b583a-09f5-4c4c-9130-4149e96a9a4d

      You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

      Use the checkbox below for a quick retry:

      • 🔍 Trigger review
      ✨ Finishing Touches
      🧪 Generate unit tests (beta)
      • Create PR with unit tests

      Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

      ❤️ Share
      Comment `@coderabbitai help` to get the list of available commands.
    2. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched

    3. Effect Service Conventions: one issue found. PiTextGeneration.ts recovers a known tagged failure with Effect.catchTag, which the conventions disallow (and which diverges from every sibling text-generation implementation that uses Effect.catchTags).

      Posted via Macroscope — Effect Service Conventions
    4. we're not adding providers right now. we'll reconsider this after our new orchestrator has shipped #2829

    5. juliusmarminge closed this

    6. @juliusmarminge Now that #2829 seems to have shipped, are you going to consider adding support for new harnesses like pi and omp? Thanks!

Sign in to join this conversation.