# Pi v1.8.0 changes Windows shell and session directory behavior for extensions

> Pi's v1.8.0 release notes list breaking changes to the shell configuration API on Windows and to how sessions choose their default directory.

- Status: official (From the company, authors or authority themselves, with a link to their own page.)
- Topic: Products
- Published: 2026-12-03T12:41:14+00:00
- Updated: 2026-12-03T13:10:05.269598+00:00
- Web page: https://ai-news.ikangai.com/story/pi-v1-8-0-changes-windows-shell-and-session-directory-behavior-for-extensions/
- Seen in: Pi releases
- Change: breaking_change (Breaking change)
- Applies to: Pi v1.8.0, getShellConfig(), Git Bash, SessionManager.open(path), openrouter-images, openrouter-chat-images, models.json

## What changed

Pi v1.8.0 passes Windows Git Bash commands through an environment variable (commandTransport "env") instead of the argument list, makes SessionManager.open(path) create new sessions in the default directory instead of the opened file's folder unless sessionDir is passed, and renames the chat-completions image API from openrouter-images to openrouter-chat-images.

Pi v1.8.0 makes three breaking changes, and two of them affect anyone who builds extensions on top of it. The shell configuration returned by getShellConfig() now passes the command to Git Bash on Windows through an environment variable instead of the argument list. New sessions created with /new, /fork and /clone now land in a different folder unless the caller says otherwise. The release notes, published on GitHub on 03 Dec, say that extensions which still append the command to args will fail with an error.

The Windows change applies to Git Bash and other bash.exe builds, not to WSL launchers. For those shells, getShellConfig() now returns commandTransport set to "env", and the command goes into the environment variable named by a new SHELL_COMMAND_ENV_VAR export. Extensions that spawn the shell from that config must set the variable themselves. The release notes tie the change to issue #12340, which is also listed among the fixes. Under Git Bash on Windows, bash commands longer than about 8 KB, or made of newline-separated words without spaces, ran only partly while reporting exit code 0. The notes do not say whether the environment-variable route covers every Windows configuration.

The session change is more involved. Before v1.8.0, SessionManager.open(path) without a sessionDir argument created new sessions in the folder of the opened file. Now it creates them in the default directory for the session's working directory, so callers who want the old behavior must pass the folder as sessionDir. The release also changes usesDefaultSessionDir(), which used to compare folders and now reports whether a custom session directory was given. v1.8.0 adds SessionManager.getCustomSessionDir(), which returns the value from --session-dir, PI_CODING_AGENT_SESSION_DIR or the sessionDir setting, or undefined for default storage. A related fix covers a session resumed under a different working directory, such as after choosing "continue in current cwd" at the missing-cwd prompt. That session had been treated as living in a custom --session-dir, so /new, /fork and /clone saved into the old project's folder.

The third breaking change is a rename in OpenRouter's image support. The chat-completions image API is now openrouter-chat-images, while openrouter-images refers to OpenRouter's POST /images endpoint. Custom models.json entries that use "api": "openrouter-images" for chat-completions image models must change to openrouter-chat-images. Image models saved in the model store by pi 1.7.0 migrate automatically when loaded. The release adds codemode support for image models served only on POST /images through the openrouter-images name, which now means that endpoint.

Beyond the breaking changes, the release adds MCP 2026-07-28, a stateless revision of the Model Context Protocol. Pi still opens every connection with initialize, and the notes say existing servers work as before. Servers that reject initialize are contacted with 2026-07-28 instead, and a stdio server that exits or refuses server/discover after rejecting initialize is started once more. Setting "protocol": "2026-07-28" in mcp.json selects the new revision for servers that speak both. The notes also add a JSON schema for mcp.json, which editors can use for validation and completion. A pi.appendUsage() call lets extensions record usage that a session's messages don't carry, such as a subagent's, so the footer's cost and session stats include it.

## Why it matters

Teams that build Pi extensions or custom models.json entries will see failures after upgrading unless they change how they spawn the shell, open sessions and name OpenRouter image APIs.

## What you can do

Extension authors and teams with custom models.json files should review these breaking changes and update their code before upgrading to v1.8.0.

## Original source

- [Release v1.8.0 · earendil-works/pi · GitHub](https://github.com/earendil-works/pi/releases/tag/v1.8.0)

---

AI wrote this summary from the sources listed, and nobody reviewed it individually before publication. Check the original source before you rely on it.

Cite as: IKANGAI AI News, "Pi v1.8.0 changes Windows shell and session directory behavior for extensions", 2026-12-03, https://ai-news.ikangai.com/story/pi-v1-8-0-changes-windows-shell-and-session-directory-behavior-for-extensions/
