Pi 1.2.0
New version of pi. Download from npm or view release on GitHub.
New Features
- Per-key OpenRouter model lists: with an OpenRouter key, Pi lists only the models that key may use, with the key's context size, max output, and prices, including regional endpoints set in
models.json. See OpenRouter. - Published configuration schemas: add
$schematosettings.json,models.json, keybindings, and themes for editor validation and completion. See Settings, Models, Keybindings, and Themes. - Clipboard copies over remote sessions:
PI_CLIPBOARD_OSC52=1sends copied text to a remote client's clipboard when Pi cannot detect the remote session, such as a multiplexer attached from another machine. See Pi Process Configuration. - Codemode improvements: tool declarations show input constraints such as integer, minimum/maximum, and default, and codemode rows show elapsed and total time. See Codemode.
before_agent_startfor extension-triggered runs: runs started bypi.sendMessage(..., { triggerTurn: true })go through the same setup as prompts. See Events and concurrency.
Breaking Changes
- Published generated configuration schemas for models, settings, keybindings, and themes at
https://pi.dev/schemas/*.schema.json. The theme schema moved tohttps://pi.dev/schemas/theme.schema.json; themes loaded during startup now receive the same schema validation as later reloads. Update theme$schemareferences, define reusable colors undervars, and remove unsupported metadata (#9880, #10751 by @christianklotz) - Changed
before_agent_startto also fire for runs started bypi.sendMessage(..., { triggerTurn: true })while idle.BeforeAgentStartEventis now a union onmessageType:"user"events carrypromptandimages, and"custom"events carry the startingmessageand noprompt. Messages returned by handlers are added to both kinds of run, and pendingdeliverAs: "nextTurn"messages are delivered with the custom-message run. Handlers that should act only on user prompts must checkevent.messageType === "user"(#10267, #5581, #10739 by @davidbrai) - Changed the session to count as busy while a run starts, including during
before_agent_starthandlers:ctx.isIdle()is false,pi.sendMessage()queues into the starting run instead of starting a second run that failed with "Agent is already processing",pi.sendUserMessage()requiresdeliverAs, and an abort requested meanwhile aborts the run once it starts (#10739 by @davidbrai) - Changed
pi mcp list --jsonto reportresources: truefor servers that offer resources instead ofresourcesandresourceTemplatescounts; Pi no longer lists resources when connecting (#10526)
Added
- Added
reachesToolsto tool definitions, so tools that reach other tools (such ascodemodeandtool_search) declare which tools a call may reach; the MCP extension uses it to wait for the servers a call needs and to decide whether a replacementcodemodeortool_searchtool can reach MCP tools - Added
aliasesto tool namespaces; codemode'sdescribeNamespace()and thenamespaceoption ofsearchTools()match them, and MCP namespaces use the server name - Added per-key OpenRouter model lists: with an OpenRouter key, Pi lists only the chat models that key may use, with the key's context size, max output, and prices, including guardrails and regional endpoints set as the base URL in
models.json. The list is saved and used offline (#10353, #10672 by @davidbrai) - Added
PI_CLIPBOARD_OSC52=1to send copied text to the terminal with OSC 52 after the local clipboard write, so copies reach a remote client's clipboard when Pi cannot detect the remote session, such as multiplexer attaches from another machine or remote IDE daemons (#10826, #10835, #10114) - Added elapsed time while a codemode script runs and its total time once finished to the codemode tool row, like bash rows (#10708)
Changed
- Changed the
showHardwareCursorsetting to use only the terminal cursor instead of also drawing Pi's reverse-video cursor - Changed codemode tool declarations to show input constraints such as integer, minimum/maximum, length, pattern, and default as
@tags on property comments, so scripts see them without the tool repeating them in descriptions (#10707) - Changed codemode declarations of MCP tools to spell out the result type (
content,structuredContent,isError) instead of referring toCallToolResult<T>, whichdescribeTool(),searchTools(), andALL_TOOLSshowed without defining it; the codemode description no longer includes the shared MCP types - Changed
serializeConversation()(compaction, branch summaries, bug reports) to omit thinking blocks; replayed thinking is often not in the live context, so including it could make a summarization request larger than the context it summarizes and fail
Removed
- Removed the unreleased experimental server, client, and plugin stack (
src/experimental,src/cli/experimental) and its source-only./clientand./experimental/pluginexports; none of it was part of the published package. The@earendil-works/pi-client,@earendil-works/pi-protocol, and@earendil-works/pi-serverpackages it used are removed and no longer released - Removed the dependency on
@earendil-works/chord