Skip to content

Add Pi provider integration#75

Open
isthatyousaf wants to merge 10 commits intoEmanuele-web04:mainfrom
isthatyousaf:feat/pi-provider-integration
Open

Add Pi provider integration#75
isthatyousaf wants to merge 10 commits intoEmanuele-web04:mainfrom
isthatyousaf:feat/pi-provider-integration

Conversation

@isthatyousaf
Copy link
Copy Markdown
Contributor

Summary

Adds Pi as a first-class DP Code provider using the direct TypeScript SDK from @mariozechner/pi-coding-agent.

  • Adds Pi contract/model support, including ProviderKind, model selection, provider start options, provider discovery, runtime raw source, static fallback model, thinking levels, and display metadata.
  • Implements a Pi provider adapter with SDK-backed session start/resume, prompt dispatch, streaming event mapping, interruption, stop/dispose, thread reads, compaction, runtime model discovery, context usage tracking, native tool lifecycle mapping, native commands, and native skills.
  • Registers Pi across server provider layers, session persistence, provider health, status ordering, and provider service routing.
  • Wires Pi into the web app provider/model picker, runtime model search and favourites, settings, Pi logo, composer traits, slash commands, skill mentions, context-window display, draft persistence, thread activation, and handoff flows.
  • Ensures Pi runs as full-access/default mode only, with no approval-required bridge and no synthetic plan mode.
  • Supports handoff to and from Pi, including Pi target runtime/interaction coercion and context-window handling so target-provider context limits win after handoff.

Notable behavior

  • Pi sessions persist through the Pi SDK session JSONL path stored in resumeCursor.sessionFile.
  • Runtime Pi model discovery is authoritative when available; openai/gpt-5 remains the static fallback.
  • Pi thinking effort maps to the SDK thinkingLevel option and is preserved in composer drafts and runtime model selections.
  • Pi native tools render through canonical DP Code runtime items, with read/list/find/grep/write/edit/bash mapped to existing tool item affordances.
  • Pi native slash commands and skills are discoverable in the composer. Pi excludes DP Code plan/default mode commands because Pi is always default-mode in this integration.

Verification

  • bun run --cwd packages/shared test src/model.test.ts — passed, 55 tests
  • bun run --cwd apps/server test src/provider/Layers/PiAdapter.test.ts src/provider/Layers/ProviderHealth.test.ts — passed, 49 tests
  • bun run --cwd apps/web test src/composerDraftStore.test.ts src/hooks/useComposerCommandMenuItems.test.ts src/lib/threadHandoff.test.ts src/providerModelOptions.test.ts src/components/chat/composerProviderRegistry.test.tsx — passed, 101 tests
  • bun run typecheck — passed across 7 packages
  • bun run fmt — passed
  • bun run lint — passed; repo still reports existing unrelated warnings, and touched Pi paths were checked separately with no new warnings

Suggested review focus

  • Pi adapter lifecycle: session start/resume, prompt dispatch, interruption, and cleanup.
  • Runtime model discovery and thinking-level behavior for SDK models.
  • Native Pi tool, command, and skill event/UX mapping.
  • Handoff behavior between Pi and Codex/Claude/Gemini/OpenCode, especially full-access/default coercion and context-window display.
  • Provider health/auth messaging for installed Pi CLI with or without configured provider credentials.

Deployment notes

  • Adds @mariozechner/pi-coding-agent to the server package.
  • Adds Pi-related app settings keys and provider metadata.
  • No database migration or external infrastructure change is required.

@github-actions github-actions Bot added size:XXL vouch:unvouched PR author is not yet trusted in the VOUCHED list. labels Apr 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XXL vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant