Pi 1.5.0 adoption
Scope
Upgrade Agent Runtime's pi-agent-core, pi-ai, and pi-coding-agent, plus Desktop's pi-ai and pi-mcp, to exactly 1.5.0. Keep the Pi release group aligned through the lockfile and exact release-age exclusions, which now include the new pi-schema package. No Host protocol, database schema, persisted provider endpoint, permission policy, extension VERSION marker, or storage ownership changes.
Official release notes: Pi 1.5.0.
Compatibility work
- Rebase the three pnpm patches onto the published 1.5.0 package layouts.
pi-agent-coreapplied unchanged.pi-aineeded manual ports where 1.5.0 replaced re-parsing with incremental tool-call parsing and moved compat schemas topi-schema:- Anthropic hosted-search capture now registers
server_tool_useandweb_search_tool_resultblocks in the adapter'sopenBlocksmap and streams the query throughToolCallArgumentsStream, instead of anindex/inputJsonscratch on the block. requiresNonEmptyReasoningReplayis declared with the pi-schema builders.- Local request-error mapping is re-inserted where 1.5.0 removed the per-block scratch cleanup from the Anthropic and OpenAI Responses catch paths.
pi-coding-agentonly needed itsApitype import re-applied.
- Anthropic hosted-search capture now registers
pi-aino longer re-exports TypeBox. Agent Runtime importsTypefrom its existing directtypeboxdependency. Tool schemas stay plain JSON Schema, so validation on pi-schema accepts them unchanged.- Bump Agent Runtime's direct
undicifrom 8.10.2 to 8.12.3 to matchpi-coding-agent1.5.0. Two 8.x copies splitpi-aiinto two peer instances and pulled undici into the sidecar entry (891 KiB, over the 500 KiB gate); one copy restores 315 KiB and the 1.4 instance topology.
Inherited without Desktop code changes
- Incremental tool-call argument parsing in providers and agent proxy streams (lower CPU and memory for large streamed tool calls).
- pi-schema coercion for plain JSON Schema tools, including MCP tools (numeric strings, single value to array). Validation messages shown to the model change wording.
- JPEG-first image resizing in the bundled coding-agent resize worker.
- Provider fixes: Gemini
consttoenum, Bedrock strict-tool retry, OpenRouter reported costs, LiteLLM overflow detection, Claude system-after-empty-assistant ordering and capped effort, Kimi K3.1 settings, GPT-5.4/5.5 tool namespace after model switch, OpenCode endpoints. - GPT-6.1 Terra and the models.dev v2 catalog in pi-ai's built-in models. Desktop's bundled models.dev catalog and overlays remain the source of what the UI offers.
Adopted 1.5 features
- Billed vs. estimated cost.
usageFromPirecords a total markedusage.cost.totalFromProviderascostStatus: "reported", even when the model has no catalog rates, and keeps unmarked totalsestimated. Replay back into Pi restores the marker. Persisted cost keeps its five numeric fields. - Served model. Agent Runtime stores Pi's
responseModelas the additiveresponseModelIdmessage field when it differs from the requested model and is not a dated snapshot of it (response-model.ts). Host-core round-trips it through record meta with no SQL migration; older builds ignore it. The model chip shows the served model and labels the requested one (chat.servedByModelin all shipped locales), and error details show both. - Extension
pi.exec().extensions/managed-exec.tsnow decodes output across chunk boundaries, caps stdout and stderr combined in bytes (default 10 MiB), terminates on overflow withtruncated: trueand a nonzero code, and resolves a spawn failure with code 1 and the spawn error in stderr.ExtensionExecResultgainstruncated. - Zhipu/Z.ai
1308. Desktop's classifier treats the JSON error code1308(plan usage limit, sent as 429) as terminalPROVIDER_ERROR, so neither retry budget replays it. - GPT-6.1 Terra. The bundled models.dev catalog is refreshed to the current snapshot, which lists
gpt-6.1-terrafor OpenAI and Azure (1.05M context, reasoning). The refresh also dropsopenai/gpt-image-1from chat records; image settings metadata lives insettings-operation-metadata.jsonand is unaffected. ChatGPT (Codex) accounts list models from the live/codex/modelsendpoint;CODEX_MODELS_CLIENT_VERSIONis unchanged because verifying a newer client version needs a real account. - Not applicable to Desktop: TUI rendering,
pi update/ self-update command, extension package changelogs, terminal keybinding hints.
Explicitly unchanged
- Existing user data needs no migration. No persisted format, RPC, Plugin SDK, or permission contract changes.
pi-coding-agentremains transitional; it is not the normal Desktop agent loop, compaction engine, or durable session store.
Validation
Task candidate: chore/pi-1-5-upgrade rebased onto 28d5d07de18f (origin/main, 2026-11-06), run from the dedicated request worktree with the primary checkout's Electron and a worktree-built debug Host.
pnpm check:pr-base,pnpm build:js, Desktop typecheck, lint, andpnpm docs:checkpassed. Pi dependency and patch gates and patch-hash fixture tests passed.- Agent Runtime: 122 test files, 1,769 tests passed. Shared: 1,402 passed. i18n: 31 passed.
- Desktop: 4,864 tests, 4,861 passed, 3 skipped, 0 failed. On the earlier base three timing-sensitive tests (
macos-signing-watchdog,npm-executable,remote-host-ssh-transport) timed out once under the full parallel run and passed 41/41 alone. - Host-core:
cargo fmt --checkpassed; 1,210 of 1,211 tests passed. The one failure,review_rpc_records_workspace_scratch_and_approved_external_write_edit, fails identically on the unmodified base commit. Clippy reports two existing warnings inreview.rsandtranscripts.rs. - Trusted-extension E2E passed 57/57.
- Hosted-search E2E passed 10/10 only with a local, uncommitted fake-host addition for
tools.fileBatchCapabilities. Without it every scenario stops withUnsupported fake-host RPC:bdc35fa12added that runtime RPC but not the handler inscripts/e2e/hosted-search-sidecar.mjs, which this change does not touch. That fixture gap is a separate fix. - No real provider or live service was used.