Repository navigation
feat(pi): wire session commands, provider UI, and docs - #557
Merged
ronak-guliani merged 3 commits intoSep 30, 2026
Merged
Conversation
Stacks on the Pi provider core: routes copy/export/share session commands end to end and exposes Pi across clients. Server wiring: - contracts rpc: provider.sessionCommand method + WsRpcGroup entry. - ProviderService shape + routing impl (decode, route, recover stopped sessions, typed unsupported-provider error). - ws handler with ProviderSessionCommandError mapping; RpcAuthorization operate scope; EnvironmentApi/LocalApi server passthroughs. - Tests: service routing (recover + unsupported), websocket round-trip (success + actionable failure), harness stubs, live adapter test (opt-in via T3_PI_LIVE_MODEL), PiTextGeneration tests. Clients: - client-runtime parsePiSessionCommand + sessionCommand atom command. - Web: Pi icon/picker/driver metadata/settings fields, model placeholder, ChatComposer argumentMode-none direct-run, ChatView send interception with copy/export/share handling. - Mobile: Pi icon, composer menu (hide session cmds without thread, direct-run for argumentMode none), ThreadComposer/DetailScreen providerCommand threading, composer-state execution with copy/share/export handoffs, new-task guard, shareTextFile helper. - Docs: docs/providers/pi.md; contracts slash-command argument tests.
Clipboard denial left the Running Pi command toast hanging. Update the notice in place so the failure is visible and actionable.
Owner
Author
E2E testing notes (real-client pass)Tested revision: Scenarios exercised
Observations / limitations
|
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Unresolved export-path file-overwrite risk and client command/error-handling issues remain.
Review effort: Lite
Findings: 2
Open (4)
What changed in this PR
Adds end-to-end Pi session-command support (/copy, /export, /share) across RPCs, server services, web/mobile clients, provider UI, tests, and documentation.
Changes:
- Wires authenticated session-command RPCs, authorization, routing, and recovery.
- Adds Pi command parsing and web/mobile command execution flows.
- Adds provider settings, icons, documentation, and test coverage.
| File | Description |
|---|---|
packages/contracts/src/server.test.ts |
Tests command argument validation. |
packages/contracts/src/rpc.ts |
Defines the session-command RPC. |
packages/contracts/src/ipc.ts |
Extends API contracts. |
packages/client-runtime/src/state/threads.ts |
Exports Pi command parsing. |
packages/client-runtime/src/state/threadCommands.ts |
Adds the command atom. |
packages/client-runtime/src/state/piSessionCommands.ts |
Parses Pi commands. |
packages/client-runtime/src/state/piSessionCommands.test.ts |
Tests parser behavior. |
docs/providers/pi.md |
Documents Pi setup and commands. |
apps/web/src/session-logic.ts |
Registers Pi provider options. |
apps/web/src/rpc/wsRpcClient.ts |
Adds web RPC support. |
apps/web/src/localApi.ts |
Adds local API passthrough. |
apps/web/src/environmentApi.ts |
Adds environment API passthrough. |
apps/web/src/components/settings/SettingsPanels.tsx |
Adds Pi settings. |
apps/web/src/components/settings/ProviderModelsSection.tsx |
Adds Pi model UI. |
apps/web/src/components/settings/providerDriverMeta.ts |
Adds Pi metadata and fields. |
apps/web/src/components/settings/AddProviderInstanceDialog.tsx |
Removes the obsolete Pi Agent entry. |
apps/web/src/components/Icons.tsx |
Updates Pi icons. |
apps/web/src/components/ChatView.tsx |
Handles web session commands. |
apps/web/src/components/ChatView.browser.tsx |
Updates browser test mocks. |
apps/web/src/components/chat/providerIconUtils.ts |
Maps the Pi icon. |
apps/web/src/components/chat/ChatComposer.tsx |
Adds direct command execution. |
apps/server/src/ws.ts |
Routes session-command RPCs. |
apps/server/src/server.test.ts |
Tests WebSocket routing. |
apps/server/src/provider/Services/ProviderService.ts |
Extends the service contract. |
apps/server/src/provider/Layers/ProviderSessionReaper.test.ts |
Updates provider fixtures. |
apps/server/src/provider/Layers/ProviderService.ts |
Implements routing and recovery. |
apps/server/src/provider/Layers/ProviderService.test.ts |
Tests routing behavior. |
apps/server/src/provider/Layers/PiAdapter.live.test.ts |
Adds opt-in live coverage. |
apps/server/src/orchestration/Layers/ProviderRuntimeIngestion.test.ts |
Updates service harnesses. |
apps/server/src/orchestration/Layers/ProviderCommandReactor.test.ts |
Updates service fixtures. |
apps/server/src/orchestration/Layers/CheckpointReactor.test.ts |
Updates service fixtures. |
apps/server/src/git/Layers/PiTextGeneration.test.ts |
Tests Pi text generation. |
apps/server/src/auth/RpcAuthorization.ts |
Authorizes session commands. |
apps/mobile/src/state/use-thread-composer-state.ts |
Implements mobile command execution. |
apps/mobile/src/lib/attachmentDownload.ts |
Adds generated-file sharing. |
apps/mobile/src/features/threads/use-composer-command-menu.ts |
Adds mobile direct commands. |
apps/mobile/src/features/threads/ThreadDetailScreen.tsx |
Threads provider commands through the UI. |
apps/mobile/src/features/threads/ThreadComposer.tsx |
Connects command selection. |
apps/mobile/src/features/threads/NewTaskDraftScreen.tsx |
Guards commands on new tasks. |
apps/mobile/src/components/ProviderIcon.tsx |
Adds the mobile Pi icon. |
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+1646
to
+1650
| [WS_METHODS.providerSessionCommand]: (input) => | ||
| observeRpcEffect( | ||
| WS_METHODS.providerSessionCommand, | ||
| Option.match(providerService, { | ||
| onNone: () => |
Comment on lines
+23
to
+24
| const outputPath = match[1]?.trim(); | ||
| return { command: "export", ...(outputPath ? { outputPath } : {}) }; |
Comment on lines
+3432
to
+3439
| onClick: () => | ||
| void navigator.clipboard?.writeText(result.url).catch(() => | ||
| toastManager.add( | ||
| stackedThreadToast({ | ||
| type: "error", | ||
| title: "Could not copy the share link", | ||
| }), | ||
| ), |
Comment on lines
+230
to
+242
| /** Save generated text through the same cache and native handoff as downloaded files. */ | ||
| export async function shareTextFile(input: { | ||
| readonly name: string; | ||
| readonly mimeType: string; | ||
| readonly text: string; | ||
| }) { | ||
| const cached = await createCachedAttachmentFile(input); | ||
| try { | ||
| cached.file.write(input.text); | ||
| await cached.preview.share(new AbortController().signal); | ||
| } finally { | ||
| cached.preview.dispose(); | ||
| } |
…ode/add-pi-provider-wiring
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.



Stacked on #554 (Pi provider core, phases 0-3). Completes phases 7-8 from upstream pingdotgg/t3code#13777, adapted to this fork.
Server wiring (phase 7)
provider.sessionCommandWS method +WsRpcGroupentry (packages/contracts/src/rpc.ts).ProviderService.sessionCommand: decode → route → recover stopped sessions → typed unsupported-provider error.ws.tshandler (maps failures toProviderSessionCommandError),RpcAuthorizationoperate scope.EnvironmentApi+LocalApiserver passthroughs; webwsRpcClientfacade entry.sendTurncursors generically);uploadFeedback-era harness lines,model-manifest.json, and upstream-only integration tests have no local counterpart and were skipped.Clients (phase 8)
parsePiSessionCommand+sessionCommandatom command.ChatComposerdirect-run forargumentMode: none,ChatViewsend interception (copy → clipboard, export → download, share → link toast).onSendMessage(providerCommand)threading, composer-state execution (copy/export/share handoffs), new-task guard,shareTextFilehelper.docs/providers/pi.md.Verification
GitHubCli.ts).server.test.tsincl. 2 new ws tests (109), reactor/reaper suites (184), web ChatView/settings (69+12), mobile threads (280). Live adapter test ported, self-skips withoutT3_PI_LIVE_MODEL.Feature captures
PR head at upload:
03ee4709c520028929a28ea62f7205632b07957e. See the testing notes for exercised behavior and limitations; uploading media is not a test result.