Pi 1.8.0
New version of pi. Download from npm or view release on GitHub.
New Features
- MCP 2026-07-28: Pi speaks the stateless MCP revision with servers that reject
initialize, or with any server when"protocol": "2026-07-28"is set. - mcp.json schema: Add
"$schema": "https://pi.dev/schemas/mcp.schema.json"tomcp.jsonfor editor validation and completion. - Unloaded llama.cpp models in
/model: When the router autoloads models,/modellists models from the Hugging Face cache and--models-dir, not only presets. - OpenRouter
/imagesmodels: Codemode image generation supports OpenRouter image models that are served only onPOST /images. pi.appendUsage(): Extensions can record model usage that the session's messages do not carry, such as a subagent's; the footer's cost and session stats count it.
Breaking Changes
getShellConfig()returnscommandTransport: "env"for Git Bash and otherbash.exeon Windows, except WSL launchers: the command goes in the environment variable named by the newSHELL_COMMAND_ENV_VARexport, not afterargs. Extensions that spawn the shell fromgetShellConfig()must set that variable; appending the command toargsfails with an error (#12340)SessionManager.open(path)withoutsessionDirnow creates new sessions (/new,/fork,/clone) in the default directory of the session's cwd instead of the opened file's folder. Pass the folder assessionDirto keep the old behavior.usesDefaultSessionDir()now says whether a custom session directory was given, rather than comparing folders- Renamed OpenRouter's chat-completions image API from
openrouter-imagestoopenrouter-chat-images;openrouter-imagesnow means OpenRouter'sPOST /imagesendpoint. Custommodels.jsonentries with"api": "openrouter-images"for chat-completions image models must switch toopenrouter-chat-images. Image models saved in the model store by pi 1.7.0 are migrated on load
Added
- Added
SessionManager.getCustomSessionDir(), the custom session directory (--session-dir,PI_CODING_AGENT_SESSION_DIRor thesessionDirsetting), orundefinedfor default storage - Added MCP
2026-07-28, the stateless revision. Pi still starts every connection withinitialize, so existing servers work as before. Servers that rejectinitializeare spoken to with2026-07-28, and their tool list changes are followed withsubscriptions/listen; a stdio server that exits or refusesserver/discoverafter rejectinginitializeis started once more."protocol": "2026-07-28"inmcp.jsonuses it with servers that speak both revisions. See Protocol versions. Based on #12479 by @dmmulroy (#10416) - Added
pi.appendUsage()so extensions can record model usage that the session's messages do not carry, such as a subagent's; the footer's cost and session stats count it (#12654, based on introspection-org/pi#2 by @brightsparc) - Published a JSON schema for
mcp.json: add"$schema": "https://pi.dev/schemas/mcp.schema.json"for editor validation and completion (#12563) - Added OpenRouter image models that are served only on
POST /imagesto codemode image generation, through the newopenrouter-imagesAPI - Added the decision models
jev-1.14,gemini-decision-1andgpt-6-luna-decisionfrom OpenCode Go (billed to the Go subscription) and OpenCode Zen formodels.classify()in codemode andctx.modelRegistry.classify()in extensions; Zen'sjev-1.13andjev-1.13-freenow also take images (#12484) - Added Baseten's decision models (bison-1, groundhog-1, elephant-1, mammoth-1, joey-1) for
models.classify()in codemode andctx.modelRegistry.classify()in extensions (#12712)
Changed
/modelnow lists unloaded llama.cpp models from the Hugging Face cache and--models-dir, not only presets, when the router autoloads models; the router loads the selected model on the first request (#12730 by @julien-c)- Changed the
opencodedefault model from the removedkimi-k2.7-codetokimi-k3.1-pro - Updated
cross-spawnto 7.1.2 for GHSA-ghv9-86vm-4v8m (command injection when spawning batch files throughcmd.exeon Windows). On Windows, an MCPcommandwith embedded arguments (such as"npx -y foo") is now quoted as one command and fails, as it already did on Linux; put the arguments inargs(#12729) - Updated
minimatchto 11.0.9 for GHSA-cf2h-pxjq-68xw, GHSA-hqmv-qgp3-jx75 and GHSA-c859-jr93-m5j4 (slow compiling of long wildcard patterns, and memory growth from the pattern cache). Glob patterns in model selection, package filters andfindon Windows that would expand to more than 100,000 patterns now fail with an error instead of hanging