minimatch and undici to patched releases used by the MiniMax packaged CLI dependency closure.shx binaries.xhigh effort support.${1:-7} for optional values. See Prompt Template Arguments.defaultProjectTrust lets users choose whether unresolved project trust asks, always trusts, or never trusts by default, and extensions can inspect effective trust decisions. See Project Trust and ctx.isProjectTrusted().# or $ so suggestions open without slash-command prefixes. See Autocomplete Providers.${1:-7} (#5553 by @dannote).areExperimentalFeaturesEnabled feature guard to allow users to opt in to early features (#5547 by @vegarsti).ctx.isProjectTrusted() for extensions to observe the effective project trust decision, including temporary trust decisions (#5523).defaultProjectTrust setting to choose whether unresolved project trust asks, always trusts, or never trusts by default.ctx.ui.addAutocompleteProvider() wrappers (#4703).@earendil-works/pi-ai for the Anthropic and Amazon Bedrock providers, with adaptive thinking and xhigh effort support.AWS_REGION (#5527 by @AJM10565).thinking: { type: "disabled" } compatibility parameter (#5330).maxTokens as max_tokens (#5331).thinking: { type: "disabled" } compatibility parameter (#5531).maxTokens metadata to 128,000, correcting an upstream value that duplicated the input sub-limit as the output limit (#5559)./reload to apply updated steeringMode and followUpMode settings to the current session (#5377).models.json syntax to skip startup config migrations and report the normal file-path-aware models error instead of a raw JSON parse stack trace (#5418).--help/--version output and simplified list/config help text./new from ephemeral sessions to keep the new session ephemeral instead of persisting it by default (#5045).name and modelOverrides.name do not replace model IDs in the footer or primary model lists (#4841).--approve / --no-approve controls for non-interactive modes. See Project Trust.project_trust, decide, remember, or defer project trust before project-local resources load. See project_trust.CH). See Interactive Mode.project_trust extension event so global and CLI extensions can decide or defer project trust during startup and runtime cwd switches../hooks subpath that pointed at non-existent build output./reload to persist project trust when an implicitly trusted session creates a project .pi directory.models.json schema support and inherited OpenAI Responses custom-provider handling for compat.supportsDeveloperRole: false (#5456).extended-keys-format csi-u and document the tmux 3.2-3.4 fallback (#5432).ctx.mode and ctx.getSystemPromptOptions() to adapt behavior across TUI, RPC, JSON, and print modes and inspect base system prompt inputs. See Extensions.@earendil-works/pi-ai for the minimax and minimax-cn direct providers (#5313).ctx.mode to extension contexts so extensions can distinguish TUI, RPC, JSON, and print mode.ctx.getSystemPromptOptions() for extension commands to inspect the current base system prompt inputs (#5306 by @xl0).~/.pi/agent/tmp/extensions directory with 0700 permissions instead of os.tmpdir()/pi-extensions.ENOENT when package.json is not present next to the bundle entrypoint. The package metadata reader now gracefully handles missing package.json by using defaults, enabling createAgentSession() without requiring package-adjacent files at runtime (#5226).httpIdleTimeoutMs setting (set via /settings HTTP timeout) now applies as the default SDK request timeout for all providers that support it, not just OpenAI Codex Responses. Disabling the timeout (HTTP timeout = false) now correctly disables SDK timeouts for all supported providers by sending a maximum int32 value (effectively infinite) instead of 0, since SDKs treat timeout=0 as an immediate timeout (#5294)./mnt/... repositories to refresh after branch changes (#5264 by @psoukie).renderShell: "self" tool renderers that emit no component lines leaving a blank chat row (#5299).--name / -n sets the session display name before startup across interactive, print, JSON, and RPC modes. See Naming Sessions and Session Options.file:// hyperlinks when the terminal supports them, including supported tmux clients.convertToPng for extension authors (#5167 by @xl0).parseArgs and type Args for extension authors (#5202 by @xl0).--name / -n to set the session display name at startup (#5153).file:// hyperlinks to file paths shown in built-in file tool titles (#5189 by @mpazik).@earendil-works/pi-ai (#5178 by @stephanmck).@mariozechner/clipboard base package and native sidecars (#5184).system instead of unsupported developer messages (#5159).thinking objects instead of invalid string values, and fixed OpenCode Zen Grok Build thinking requests to omit unsupported reasoning_effort (#5169).--exclude-tools / -xt disables specific built-in, extension, or custom tools while leaving the rest available. See Tool Options./login can use device-code auth for ChatGPT Plus/Pro Codex subscriptions. See Subscriptions and OpenAI Codex.InputEvent.streamingBehavior. See Input Events.--exclude-tools / -xt to disable specific built-in, extension, or custom tools while leaving the rest available (#5109).streamingBehavior to extension input events so extensions can distinguish idle prompts from mid-stream steers and queued follow-ups (#5107 by @DanielThomas).readPipedStdin no longer includes createAgentSessionRuntime work (#4829).xhigh reasoning metadata to preserve OpenRouter's native effort instead of sending DeepSeek's max effort (#4801).session_shutdown cleanup and restore the terminal: signal-triggered shutdown now emits session_shutdown before any terminal writes, and SIGHUP no longer hard-exits, so extension resources (e.g. sockets) are released even when the terminal is gone (#5080).$ENV_VAR / ${ENV_VAR} interpolation and $! bang escaping, and require explicit env syntax for config files, avoiding Windows case-insensitive env matches corrupting literal keys (#5095).pi.getAllTools() to expose each tool's promptGuidelines for extensions that need per-tool guideline attribution (#4879).allowEmptySignature compatibility flag (#4464).thinking: "none" (#5078).mimo-v2-flash variants (#5075).agent_end extension handlers to drain before the agent becomes idle (#5115 by @DanielThomas).streamingBehavior only for prompts actually queued during streaming (#5107 by @DanielThomas).diff code blocks and other highlight.js scopes to keep theme-aware syntax colors after the cli-highlight replacement (#5092).--session-id <id> lets scripts create or resume an exact project-local session. See Sessions.excludeFromContext to bash for commands whose output should not be sent with the next prompt. See RPC mode.retry.provider.maxRetries controls provider retries instead of hidden SDK defaults. See Retry settings.--session-id to let CLI callers use an exact project-local session ID, creating it if missing (#4874).excludeFromContext flag to the bash RPC command for parity with the internal executeBash API (#5039).pi update runs (#4929).httpIdleTimeoutMs to apply to OpenAI Codex Responses WebSocket idle waits, added websocketConnectTimeoutMs for bounded WebSocket connect waits, and added a 10s Codex SSE response-header timeout (#4945).RpcClient to reject pending requests and consume stdin pipe errors when the child process exits unexpectedly (#4764).session-id instead of proxy-incompatible session_id (#4967).openai-codex/gpt-5.3-codex-spark model metadata to use its 128k context window (#4969).maximum allowed input length errors (#4943).retry.provider.maxRetries is honored, SDK retries default to 0, and quota/billing 429s are not retried behind Pi's retry handling (#4991 by @mitsuhiko).Shift+Enter by detecting local macOS modifier state when Terminal.app sends plain Return.AGENTS.md link to point at the pi-mono guidelines (#5041).read tool cards now show only the read line by default, while Ctrl+O still expands the full file content.pi update and git package installs now reconcile pinned git refs and keep package settings intact. See Packages.compat.forceAdaptiveThinking. See Custom providers and Models.compat.forceAdaptiveThinking support to custom Anthropic-compatible model configuration docs and validation (#4797 by @mbazso).koffi dependency for Windows VT input with a tiny vendored native helper, reducing install size while preserving Shift+Tab handling (#4480).npm install --ignore-scripts (#4868).pi update to reconcile git-pinned packages to their configured ref (#4869).@smithy/node-http-handler dependency from @earendil-works/pi-ai (#4842).@mariozechner/clipboard (#4307).pi update runs, so users can see the installed version's changelog before continuing (#4724 by @mitsuhiko).npm-shrinkwrap.json to lock transitive dependencies for the CLI package.ctx.abort() during tool-call preflight to stop later confirmations and restore queued interactive input like Escape (#4276).willRetry to agent_end session events.@earendil-works/pi-tui so initialization cannot run before frames are available.@earendil-works/pi-ai to avoid reserving impossible context windows on servers such as vLLM (#4675).@earendil-works/pi-ai to stay within the 64-character provider limit (#4720)..cmd shims (#4793).install export (#4661 by @dmasiero).reasoning_content for thinking-mode multi-turn requests, inherited from @earendil-works/pi-ai (#4678).pi update --self detection for pnpm v11 global installs whose package path resolves through the pnpm store (#4647)..cmd shim internals (#4665).ANTHROPIC_AUTH_TOKEN environment values, avoiding invalid bearer credentials for providers such as Xiaomi MiMo inherited from @earendil-works/pi-ai (#4342).@earendil-works/pi-ai (#4223).errorMessage, so transient 5xx and 429 errors are correctly matched by the agent-level auto-retry classifier inherited from @earendil-works/pi-ai (#4232).reasoning fields back to reasoning_content for OpenCode Go only, inherited from @earendil-works/pi-ai (#4251).openai-completions API, restoring multi-turn thinking/tool-call sessions inherited from @earendil-works/pi-ai (#4505).@earendil-works/pi-ai.@earendil-works/pi-ai (#4603 by @mattiacerutti).@earendil-works/pi-ai to map unsupported minimal thinking to low (#4622 by @mattiacerutti).~/.pi/agent/npm/ instead of npm's global package root, avoiding permission errors with system-managed Node installs (#4587).@earendil-works/pi-ai (#4614).@earendil-works/pi-ai./login API-key auth, default model resolution, and setup docs. See README.md#providers--models and docs/providers.md.@earendil-works/pi-tui.@earendil-works/pi-ai, including image generation APIs, image model metadata, and built-in OpenRouter image generation support (#3887 by @cristinaponcela)./login API-key auth, and default model resolution (#3624 by @Nutlope).fd auto-download on macOS x86_64 by pinning the last release that ships an Intel macOS binary (#4559).--resume session listing to cap in-flight session metadata loads and avoid OOM on large session histories (#4583)..agents package provenance metadata to survive package-manager scans.message_stop (#4433).strip-ansi behavior after dependency removal.@earendil-works/pi-ai.@earendil-works/pi-tui.Theme not initialized (#4333).earendil-works/pi-mono and @earendil-works/* package scopes.pi update --self now supports the upcoming package rename from @mariozechner/pi-coding-agent to @earendil-works/pi-coding-agent. After the new package is published, existing global installs can update through the normal self-update flow; pi will uninstall the old global package and install the package name returned by the version check endpoint./login, enabling provider-specific interactive authentication flows. See Providers.models.json parsing: models.json now allows comments and trailing commas, making custom provider and model configuration easier to maintain. See Providers and Custom Providers.pi update --self to honor the active package name returned by the Pi version check endpoint, defaulting to the current package when omitted and uninstalling the old global package before installing a renamed package.jiti 2.7 instead of the @mariozechner/jiti fork (#4244 by @pi0).models.json parsing to allow comments and trailing commas (#4162 by @julien-c).pi -p treating prompts that start with YAML frontmatter as extension flags instead of user messages (#4163)./copy reporting success on Linux without writing the clipboard on Wayland-only compositors (Hyprland, Niri, ...) by skipping the X11-only native addon on Linux and routing through wl-copy/xclip/xsel instead (#4177).xiaomi now uses API billing, with separate xiaomi-token-plan-{cn,ams,sgp} providers. See docs/providers.md#api-keys and README.md#providers--models. (#4112 by @Phoen1xCode)read output for Pi docs, context files, and skills is collapsed by default and shows selected line ranges.xiaomi provider from Token Plan AMS to Xiaomi's API billing endpoint, and renamed its /login display from "Xiaomi MiMo Token Plan" to "Xiaomi MiMo". XIAOMI_API_KEY now refers to the API billing key from platform.xiaomimimo.com. Users on Token Plan should switch to the appropriate xiaomi-token-plan-* provider and set the corresponding env var (#4112 by @Phoen1xCode)./login: xiaomi-token-plan-cn (XIAOMI_TOKEN_PLAN_CN_API_KEY), xiaomi-token-plan-ams (XIAOMI_TOKEN_PLAN_AMS_API_KEY), xiaomi-token-plan-sgp (XIAOMI_TOKEN_PLAN_SGP_API_KEY). Each defaults to mimo-v2.5-pro (#4112 by @Phoen1xCode).read tool rendering to collapse Pi documentation, AGENTS/CLAUDE context files, and SKILL.md contents by default in interactive output.xhigh thinking requests by preserving the provider's native effort value.--print and JSON mode processes alive after the response by closing cached WebSocket sessions during session shutdown (#4103).read tool calls to render directly and include selected line ranges in interactive output.XIAOMI_API_KEY auth, default model (mimo-v2.5-pro), and /login display. See docs/providers.md. (#4005 by @Phoen1xCode).thinkingLevelMap, replacing the old reasoningEffortMap. See docs/models.md#thinking-level-map and docs/custom-provider.md. (#3208).pi.registerProvider() now respects per-model baseUrl settings. See docs/custom-provider.md. (#4063).shouldStopAfterTurn. See packages/agent/README.md.pi now correctly identifies and applies available updates. (#3942, #3980, #3922).compat.reasoningEffortMap in models.json and pi.registerProvider() model definitions with model-level thinkingLevelMap (#3208). Migration: move old mappings from compat.reasoningEffortMap to thinkingLevelMap. Use string values for provider-specific thinking values and null for unsupported pi levels that should be hidden and skipped by cycling. See docs/models.md#thinking-level-map and docs/custom-provider.md.XIAOMI_API_KEY, default model resolution, /login display support, and provider documentation (#4005 by @Phoen1xCode).thinkingLevelMap support in models.json and pi.registerProvider(), allowing models to expose only the thinking levels they actually support (#3208).shouldStopAfterTurn agent loop callback for post-turn stop control, inherited from @mariozechner/pi-agent-core. See packages/agent/README.md.auto, allowing OpenAI Codex to use cached WebSocket context when available (#4083).pi.registerProvider() to honor per-model baseUrl overrides (#4063).pi correctly identifies when a newer version is available and applies updates (#3942, #3980, #3922).websocket-cached to the transport setting options for the OpenAI Codex provider used with ChatGPT subscription auth. This keeps the same WebSocket open for a session and, after the first request, sends only the new conversation items instead of resending the full chat history when possible.CLOUDFLARE_API_KEY/CLOUDFLARE_ACCOUNT_ID/CLOUDFLARE_GATEWAY_ID, default model resolution, and /login display. See docs/providers.md#cloudflare-ai-gateway. (#3856 by @mchenco).MOONSHOT_API_KEY, default model resolution, and /login display.message_end messages, wrap custom editor factories via ctx.ui.getEditorComponent(), and observe thinking level changes. See docs/extensions.md#message_start--message_update--message_end, docs/extensions.md#widgets-status-and-footer, and docs/extensions.md#thinking_level_select.PI_CODING_AGENT_SESSION_DIR configures session storage from the environment. See docs/usage.md#environment-variables.CLOUDFLARE_API_KEY/CLOUDFLARE_ACCOUNT_ID/CLOUDFLARE_GATEWAY_ID setup, default model resolution, /login display support, and provider documentation (#3856 by @mchenco).MOONSHOT_API_KEY setup, default model resolution, and /login display support.@mariozechner/pi-ai (#4009 by @technocidal).PI_CODING_AGENT_SESSION_DIR as an environment equivalent to --session-dir (#4027).message_end extension result support for replacing finalized messages, enabling extensions to override assistant usage cost (#3982).name support to pi.registerProvider() so extension-registered providers can show a friendly name in /login (#3956).ctx.ui.getEditorComponent() so extensions can wrap the currently configured custom editor factory (#3935).thinking_level_select extension event for observing thinking level changes (#3888).edit tool results rendering the rejection reason twice after interactive extension confirmation (#3830).@mariozechner/pi-agent-core (#4023).grep and find tool argument injection for flag-like search patterns (#4018).node_modules discovery when npmCommand is configured to use Bun (#3998 by @thirtythreeforty).ProcessTerminal sizing to use COLUMNS and LINES before falling back to 80x24 (#4004).@anthropic-ai/sdk to clear GHSA-p7fg-763f-g4gf audit findings (#3992).@mariozechner/clipboard to an attested release so package managers with trust policies do not reject installs (#3946).AGENTS.MD files in addition to AGENTS.md (#3949)./handoff to use compacted session context instead of pre-compaction raw messages (#3945).xhigh thinking support so requests map to DeepSeek's max reasoning effort (#3944).message_stop to be treated as errors instead of successful partial responses (#3936).lodash-es transitive dependency (#3901).CLOUDFLARE_API_KEY/CLOUDFLARE_ACCOUNT_ID setup. See docs/providers.md#api-keys. (#3851 by @mchenco)pi.dev and identify Pi with a pi/<version> user agent. See docs/packages.md. (#3877 by @mitsuhiko)CLOUDFLARE_API_KEY/CLOUDFLARE_ACCOUNT_ID setup, default model resolution, /login support, and provider documentation (#3851 by @mchenco).pi/<version> user agent (#3877 by @mitsuhiko).node_modules relative to Bun's install layout (#3861 by @thirtythreeforty).fdfind when fd is unavailable.pi update to skip self-update reinstalls when the installed version is already current (#3853).pi update --self detection and execution for Windows package-manager shim installs, including symlinked global package roots, and print the manual fallback command when self-update fails (#3857).pi startup failing because the session selector imported a source-only utility path.pi update can now update pi itself in addition to installed pi packages. See docs/packages.md. (#3680 by @mitsuhiko)warnings.anthropicExtraUsage in /settings. See docs/settings.md. (#3808)ctx.ui.setWorkingVisible(), allowing extensions to hide the built-in loader row and render custom working state. See docs/extensions.md and examples/extensions/border-status-editor.ts. (#3674)pi update support for updating pi itself in addition to installed pi packages (#3680 by @mitsuhiko).warnings.anthropicExtraUsage and a /settings warnings submenu to suppress the Anthropic extra usage billing warning (#3808)ctx.ui.setWorkingVisible() so extensions can hide the built-in interactive working loader row without reserving layout space, plus a border-status editor example that moves working state into a custom editor border (#3674)/proc/self/environ when Bun's sandbox leaves process.env empty (#3801 by @mdsjip).process.env is empty (#3807 by @mdsjip).low when no verbosity is specified.tools arrays to providers that reject them when tools are disabled (#3650 by @HQidea).done terminators (#3708).models.json entries to preserve built-in model lists (#3651)./login to show auth supplied by models.json provider definitions.pi.setSessionName() updates to refresh the interactive terminal title immediately (#3686)/tree cancellation via session_before_tree leaving the session stuck in compaction state (#3688)UND_ERR_BODY_TIMEOUT by disabling undici bodyTimeout/headersTimeout on the global dispatcher; provider SDKs continue to enforce their own deadlines via retry.provider.timeoutMs (#3715)timeout must be an integer when retry.provider.timeoutMs is not configured (#3627)DEEPSEEK_API_KEY authentication. See README.md#providers--models and docs/providers.md#api-keys.retry.provider.{timeoutMs,maxRetries,maxRetryDelayMs}, useful for long-running local inference and provider SDK retry behavior. See docs/settings.md#retry. (#3627)/copy to avoid unbounded OSC 52 writes and clipboard races that could break terminal rendering or panic the native clipboard addon (#3639)pi.getFlag() using registered flag names without the CLI -- prefix (#3614)retry.provider.{timeoutMs,maxRetries,maxRetryDelayMs}, migrating legacy retry.maxDelayMs, and forwarding provider controls into streamSimple request options (#3627)cmd.exe for native git commands, so install paths containing spaces no longer break pi install git:... with fatal: Too many arguments (#3642)reasoning_content fields (#3636)/login provider selector now supports fuzzy search/filtering, making it faster to find providers when many are configured. See docs/providers.md. (#3572 by @mitsuhiko)openai-codex/gpt-5.5 is available as a model option, including xhigh reasoning support and corrected priority-tier pricing.terminal.showTerminalProgress in /settings (#3588)--no-builtin-tools / createAgentSession({ noTools: "builtin" }) now correctly disables only built-in tools while keeping extension tools active. See docs/extensions.md and README.md (#3592)terminal.showTerminalProgress to true in /settings to re-enable (#3588)/login so provider entries can show when auth comes from --api-key, an environment variable, or custom provider fallback without exposing secrets.pi/command ctx and use withSession for post-replacement work./model selector cancellation to request render instead of incorrectly triggering login selector./login and updated /model copy to refer to configured providers instead of only API keys./login for OAuth or API key setup./quit shutdown ordering to stop the TUI before extension UI teardown can repaint, preserving the final rendered frame while still emitting session_shutdown before process exit.SettingsManager.inMemory() initial settings being lost after reloads triggered by SDK resource loading (#3616)models.json provider compatibility to accept compat.supportsLongCacheRetention, allowing proxies to opt out of long-retention cache fields when needed while long retention is enabled by default when requested (#3543)--thinking xhigh for openai-codex gpt-5.5 so it is no longer downgraded to high.npmCommand values such as pnpm by avoiding npm-specific production flags in that compatibility path (#3604)ctx errors when it installs the generated prompt (#3606)/quit teardown ordering to run host-owned extension UI cleanup synchronously after session_shutdown handlers complete but before invalidating the old extension context, preventing stale extension UI from rendering against a disposed session (#3597 by @vegarsti)/quit when an extension registers a custom footer whose render() accesses ctx, by tearing down extension-provided UI before invalidating the extension runner during shutdown (#3595)http2 request did not get a response as transient errors, so the agent retries automatically instead of waiting for a manual nudge (#3594)--no-builtin-tools and createAgentSession({ noTools: "builtin" }) disable only built-in default tools while keeping extension/custom tools enabled, instead of falling through to the same "disable everything" path as --no-tools (#3592)pi / .pi branding to route through APP_NAME and CONFIG_DIR_NAME extension points, so SDK rebrands get consistent naming in /quit description, process.title, and the project-local extensions directory (#3583 by @jlaneve)pi-coding-agent shipping uuid@11, which triggered npm audit moderate vulnerability reports for downstream installs; the package now depends on uuid@14 (#3577)openai-completions streamed tool-call assembly to coalesce deltas by stable tool index when OpenAI-compatible gateways mutate tool call IDs mid-stream, preventing malformed Kimi K2.6/OpenCode tool streams from splitting one call into multiple bogus tool calls (#3576)ctx.ui.setWorkingMessage() to persist across loader recreation, matching the behavior of ctx.ui.setWorkingIndicator() (#3566)fs.watch error handling for theme and git-footer watchers to retry after transient watcher failures such as EMFILE, avoiding startup crashes in large repos (#3564)kimi-coding model generation to attach the expected User-Agent header so direct Kimi Coding requests use the provider's expected client identity (#3586)models.json Anthropic-compatible provider configuration to accept compat.supportsEagerToolInputStreaming, allowing proxies that reject per-tool eager_input_streaming to use the legacy fine-grained tool streaming beta header instead (#3575)index.js/index.ts suffixes (#3596 by @aliou)completion_tokens (#3581)openai-responses compatibility for strict OpenAI-compatible proxies by allowing models.json to disable the underscore-containing session_id header with compat.sendSessionIdHeader: false (#3579)low and apply the model's 2.5x priority service-tier pricing multiplier (#3618 by @markusylisiurunen)ctx.ui.addAutocompleteProvider(...), allowing extensions to layer custom completion logic on top of built-in slash and path completion. See docs/extensions.md#autocomplete-providers and examples/extensions/github-issue-autocomplete.ts.terminate: true, allowing custom tools to end on a final tool call without paying for an automatic follow-up LLM turn. See docs/extensions.md and examples/extensions/structured-output.ts.@sinclair/typebox 0.34.x to typebox 1.x. New extensions, SDK integrations, and pi packages should depend on and import from typebox. Legacy extension loading still aliases the root @sinclair/typebox package, but @sinclair/typebox/compiler is no longer shimmed. This migration also picks up the new @mariozechner/pi-ai TypeBox-native validator path, so tool argument validation now works in eval-restricted runtimes such as Cloudflare Workers instead of being skipped (#3112)ctx.newSession(), ctx.fork(), and ctx.switchSession(). Old pi and command ctx references now throw instead of silently targeting the replaced session. Migration: if code needs to keep working in the replacement session after one of those calls, pass withSession to that same method and do the post-switch work there. In practice, move post-switch pi.sendUserMessage(), pi.sendMessage(), and command-ctx/session-manager access into withSession, and use only the ReplacedSessionContext passed to that callback for session-bound operations. Footguns: withSession runs after the old extension instance has already received session_shutdown, old cleanup may already have invalidated captured state, captured old pi / old command ctx are stale, and previously extracted raw objects such as const sm = ctx.sessionManager remain the caller's responsibility and must not be reused after the switch.terminate: true, allowing custom tools to end the current tool batch without an automatic follow-up LLM call, plus a structured-output.ts extension example and extension docs showing the pattern (#3525)ctx.ui.addAutocompleteProvider(...) for stacking extension autocomplete providers on top of the built-in slash/path provider, plus a github-issue-autocomplete.ts example and extension docs (#2983)javascript:-style payloads while preserving safe links in shared/exported sessions (#3532)ctx.getSystemPrompt() inside before_agent_start to reflect chained system-prompt changes made by earlier before_agent_start handlers, and clarified the extension docs around provider-payload rewrites and what ctx.getSystemPrompt() does and does not report (#3539)google-gemini-cli model lists and selector entries to include gemini-3.1-flash-lite-preview, so Cloud Code Assist users no longer need manual --model fallback selection to use it (#3545)ctx.newSession(), ctx.fork(), ctx.switchSession(), and imported-session replacements fully rebind before post-switch work runs, added withSession replacement callbacks with fresh ReplacedSessionContext helpers, and make stale pre-replacement pi / ctx session-bound accesses throw instead of silently targeting the wrong session (#2860)models.json built-in provider overrides to accept headers without requiring baseUrl, so request-header-only overrides now load and apply correctly (#3538)FIREWORKS_API_KEY auth. See README.md#providers--models and docs/providers.md.terminal.imageWidthCells in /settings. See docs/settings.md#terminal--images.FIREWORKS_API_KEY setup/docs and the default Fireworks model accounts/fireworks/models/kimi-k2p6 (#3519)terminal.imageWidthCells via /settings, so tool-output images are no longer hard-capped to 60 terminal cells (#3508)sessionDir in settings.json to expand ~, so portable session-directory settings no longer require a shell wrapper (#3514)<file name="...">...</file> verbatim, so shared sessions match the TUI instead of letting the browser interpret message text (#3484)grep and find output through their existing TUI renderers and ls output through a native template renderer, avoiding missing formatting and spacing artifacts in shared sessions (#3491 by @aliou)@ autocomplete fuzzy search to follow symlinked directories and include symlinked paths in results (#3507)fine-grained-tool-streaming beta header with per-tool eager_input_streaming, and updating stale test model references (#3175)AWS_REGION / AWS_PROFILE, restoring us.* and eu.* inference profile support after v0.68.0 while preserving custom VPC/proxy endpoint overrides (#3481, #3485, #3486, #3487, #3488)ctx.ui.setWorkingIndicator(), including animated, static, and hidden indicators. See docs/tui.md#working-indicator, docs/extensions.md, and examples/extensions/working-indicator.ts.before_agent_start now exposes systemPromptOptions (BuildSystemPromptOptions) so extensions can inspect the structured system-prompt inputs without re-discovering resources. See docs/extensions.md#before_agent_start and examples/extensions/prompt-customizer.ts./clone duplicates the current active branch into a new session, while extensions can choose whether to fork before or at an entry via ctx.fork(..., { position }). See README.md, docs/extensions.md, and docs/session.md.createAgentSession({ tools }) now expects string[] names such as "read" and "bash" instead of Tool[], --tools now allowlists built-in, extension, and custom tools by name, and --no-tools now disables all tools by default rather than only built-ins. Migrate SDK code from tools: [readTool, bashTool] to tools: ["read", "bash"] (#2835, #3452)@mariozechner/pi-coding-agent, including readTool, bashTool, editTool, writeTool, grepTool, findTool, lsTool, readOnlyTools, codingTools, and the corresponding *ToolDefinition values. Use the explicit factory exports instead, for example createReadTool(cwd), createBashTool(cwd), createCodingTools(cwd), and createReadToolDefinition(cwd) (#3452)process.cwd() / default agent-dir fallback behavior from public resource helpers. DefaultResourceLoader, loadProjectContextFiles(), and loadSkills() now require explicit cwd/agent-dir style inputs, and exported system-prompt option types now require an explicit cwd. Pass the session or project cwd explicitly instead of relying on process-global defaults (#3452)ctx.ui.setWorkingIndicator(), including custom animated frames, static indicators, hidden indicators, a new working-indicator.ts example extension, and updated extension/TUI/RPC docs (#3413)systemPromptOptions (BuildSystemPromptOptions) to before_agent_start extension events, so extensions can inspect the structured inputs used to build the current system prompt (#3473 by @dljsjr)/clone to duplicate the current active branch into a new session, while keeping /fork focused on forking from a previous user message (#2962)ctx.fork() support for position: "before" | "at" so extensions and integrations can branch before a user message or duplicate the current point in the conversation; the interactive clone/fork UX builds on that runtime support (#3431 by @mitsuhiko)keybindings.json (#3343 by @mpazik)PI_OAUTH_CALLBACK_HOST support for built-in OAuth login flows, allowing local callback servers used by pi auth to bind to a custom interface instead of hardcoded 127.0.0.1 (#3409 by @Michaelliv)reason and targetSessionFile metadata to session_shutdown extension events, so extensions can distinguish quit, reload, new-session, resume, and fork teardown paths (#2863)pi update to batch npm package updates per scope and run git package updates with bounded parallelism, reducing multi-package update time while preserving skip behavior for pinned and already-current packages (#2980)maxTokens when model token limits are unknown and to omit temperature when unset, letting Bedrock use provider defaults and avoid unnecessary TPM quota reservation (#3400 by @wirjo)AgentSession system-prompt option initialization to avoid constructing an invalid empty BuildSystemPromptOptions, so npm run check passes after cwd became mandatory.process.cwd() state during bash execution, so session/project-specific shellPath settings now follow the active coding-agent session cwd instead of the launcher cwd (#3452)ctx.ui.setWorkingIndicator() custom frames to render verbatim instead of forcing the theme accent color, so extensions now own working-indicator coloring when they customize it (#3467)pi update reinstalling npm packages that are already at the latest published version by checking the installed package version before running npm install <pkg>@latest (#3000)@ autocomplete plain queries to stop matching against the full cwd/base path, so path fragments in worktree names no longer crowd out intended results such as @plan (#2778)read can warn when the current model does not support images (#3429)openai-completions assistant replay to preserve compat.requiresThinkingAsText text-part serialization, avoiding same-model follow-up crashes when previous assistant messages mix thinking and text (#3387)sessionId and cacheRetention to prompt caching fields, sending prompt_cache_key when caching is enabled and prompt_cache_retention: "24h" for direct api.openai.com requests with long retention (#3426)session_id, x-client-request-id, and x-session-affinity headers from sessionId via compat.sendSessionAffinityHeaders, improving cache-affinity routing for backends such as Fireworks (#3430)/resume session relationships and current-session detection to canonicalize symlinked session paths during selector comparisons, so shared session directories no longer break parent-child matching or active-session delete protection (#3364)/session, Sessions docs, and CLI help to consistently document that session reuse supports both file paths and session IDs, and that /session shows the current session ID (#3390)\\.pnpm\\ store paths, so update notices now suggest pnpm install -g @mariozechner/pi-coding-agent instead of falling back to npm (#3378)@sinclair/typebox runtime dependency in @mariozechner/pi-coding-agent, so strict pnpm installs no longer fail with ERR_MODULE_NOT_FOUND when starting pi (#3434)modifyOtherKeys input and normalizing shifted letter matching, so Shift+letter no longer disappears in pi (#3436)/compact to reuse the session thinking level for compaction summaries instead of forcing high, avoiding invalid reasoning-effort errors on github-copilot/claude-opus-4.7 sessions configured for medium thinking (#3438)T and O shortcuts with clickable header toggles for thinking and tool visibility instead of browser-reserved Ctrl+T / Ctrl+O bindings (#3374 by @vekexasia)pi config no longer shows duplicate skill entries when ~/.pi/agent/skills points to ~/.agents/skills (#3417 by @rwachtler)HTTP-Referer: https://pi.dev, X-OpenRouter-Title: pi, X-OpenRouter-Categories: cli-agent) when sessions are created through the coding-agent SDK and install telemetry is enabled (#3414)compat schema/docs to support cacheControlFormat: "anthropic" for OpenAI-compatible providers that expose Anthropic-style prompt caching via cache_control markers (#3392)$schema, $defs, and related metadata (#3412 by @vladlearns)model.baseUrl as the runtime client endpoint, restoring support for custom Bedrock VPC or proxy routes (#3402 by @wirjo)edit tool to coerce stringified edits JSON before validation, so models that send the array payload as a JSON string no longer fall back to ad-hoc shell edits (#3370 by @dannote)skills/**/*.md (#3350 by @neonspectra)AWS_BEARER_TOKEN_BEDROCK, enabling Converse API access without local SigV4 credentials. See docs/providers.md#amazon-bedrock.AWS_BEARER_TOKEN_BEDROCK, enabling coding-agent sessions to use Bedrock Converse without local SigV4 credentials (#3125 by @wirjo)/scoped-models Alt+Up/Down to stay a no-op in the implicit all enabled state instead of materializing a full explicit enabled-model list and marking the selector dirty (#3331)400 errors when starting sessions on mistral-small-2603 and mistral-small-latest (#3338){} payloads (#3325)YYYY-MM-DD format instead of locale-dependent output, keeping prompts deterministic across runtimes and locales (#2814)Network connection lost. as retryable, so dropped provider connections retry instead of terminating the agent (#3317)index.ts entries by using package-aware labels and the minimal parent path needed to make local entries unique (#3308)npm install --omit=dev) during both install and update flows, so extension runtime dependencies must come from dependencies and not devDependencies (#3009)tool_result / afterToolCall extension handling for error results by forwarding details and isError overrides through AgentSession instead of dropping them when isError was already true (#3051)RpcClient and RPC protocol types from @mariozechner/pi-coding-agent, so ESM consumers can import them from the main package entrypoint (#3275)afterToolCall hook throws into error tool results instead of aborting the remaining tool batch (#3084)PI_PACKAGE_DIR for built-in themes, HTML export templates, and interactive bundled assets (#3074)/import handling to support quoted JSONL paths with spaces, route missing JSONL files through the non-fatal SessionImportFileNotFoundError path, and document the importFromJsonl() exceptions (SessionImportFileNotFoundError, MissingSessionCwdError).argument-hint frontmatter field that renders before the description in the / autocomplete dropdown, using <angle> for required and [square] for optional arguments. See docs/prompt-templates.md#argument-hints.after_provider_response extension hook lets extensions inspect provider HTTP status codes and headers immediately after each response is received and before stream consumption begins. See docs/extensions.md.Ctrl+O to toggle the expanded listing.argument-hint frontmatter field for prompt templates, displayed before the description in the autocomplete dropdown (#2780 by @andresvi94)after_provider_response extension hook so extensions can inspect provider HTTP status codes and headers after each provider response is received and before stream consumption begins (#3128)Ctrl+O to toggle the expanded listing (#3267)hyperlinks: false for unknown terminals and force it off under tmux/screen (including nested sessions), preventing markdown link URLs from disappearing on terminals that silently swallow OSC 8 sequences (#3248)--verbose startup output to begin with expanded startup help and loaded resource listings after the compact startup header change (#3147)find tool returning no results for path-based glob patterns such as src/**/*.spec.ts or some/parent/child/** by switching fd into full-path mode and normalizing the pattern when it contains a / (#3302)find tool applying nested .gitignore rules across sibling directories (e.g. rules from a/.gitignore hiding matching files under b/) by dropping the manual --ignore-file collection and delegating to fd's hierarchical .gitignore handling via --no-require-git (#3303)api.openai.com base URLs (OpenAI-compatible proxies such as litellm, theclawbay) by sending the session_id and x-client-request-id cache-affinity headers unconditionally when a sessionId is provided, matching the official Codex CLI behavior (#3264 by @vegarsti)preset example extension to snapshot the active model, thinking level, and tool set on the first preset application and restore that state when cycling back to (none), instead of falling back to a hardcoded default tool list (#3272 by @stembi)xhigh reasoning to provider-supported effort values (#3286 by @markusylisiurunen)Shift+Enter regressions by reverting the Zellij-specific Kitty keyboard query bypass and restoring the previous keyboard negotiation behavior (#3259)--no-context-files (-nc) disables automatic AGENTS.md / CLAUDE.md discovery when you need a clean run without project context injection. See README.md#context-files.loadProjectContextFiles() is now exported as a standalone utility for extensions and SDK-style integrations that need to inspect the same context-file resolution order used by the CLI. See README.md#context-files.after_provider_response extension hook lets extensions inspect provider HTTP status codes and headers immediately after response creation and before stream consumption. See docs/extensions.md.--no-context-files (-nc) to disable AGENTS.md and CLAUDE.md context file discovery and loading (#3253)loadProjectContextFiles() as a standalone utility so extensions can discover project context files without instantiating a full DefaultResourceLoader (#3142)after_provider_response extension hook so extensions can inspect provider HTTP status codes and headers after each provider response is received and before stream consumption begins (#3128)claude-opus-4-7 model for Anthropic.cache_control breakpoint on the last tool definition, so tool schemas can be cached independently from transcript updates while preserving existing cache retention behavior (#3260)~~text~~) with non-whitespace boundaries.bash tool child processes on exit signals, preventing orphaned background processes.edit-tool-no-full-redraw TUI tests by waiting for asynchronous preview and preflight error rendering instead of relying on fixed render ticks.kimi-coding default model selection to use kimi-for-coding instead of kimi-k2-thinking (#3242)ctrl+z on native Windows to avoid crashing interactive mode, disable the default suspend binding there, and show a status message when suspend is invoked manually (#3191)find tool cancellation and responsiveness on broad searches by making .gitignore discovery and fd execution fully abort-aware and non-blocking (#3148)grep broad-search stalls when context=0 by formatting match lines from ripgrep JSON output instead of doing synchronous per-match file reads (#3205)renderShell: "self" for custom and built-in tool renderers so tools can own their outer shell instead of the default boxed shell. Useful for stable large previews such as edit diffs. See docs/extensions.md#custom-rendering.renderShell: "self" for custom and built-in tool renderers so tools can own their outer shell instead of using the default boxed shell. This is useful for stable large previews such as edit diffs (#3134)/reload to render a static reload status box instead of an animated spinner, avoiding redraw instability during interactive reloads.plan-mode example extension to allow eza in the read-only bash allowlist instead of the deprecated exa command (#3240 by @rwachtler)google-vertex API key resolution to treat gcp-vertex-credentials as an Application Default Credentials marker instead of a literal API key, so marker-based setups correctly fall back to ADC (#3221 by @deepkilo)prompt to wait for prompt preflight success before emitting its single authoritative response, while still treating handled and queued prompts as success (#3049)/scoped-models reordering to propagate into the /model scoped tab, preserving the user-defined scoped model order instead of re-sorting it (#3217)session_shutdown to fire on SIGHUP and SIGTERM in interactive, print, and RPC modes so extensions can run shutdown cleanup on those signal-driven exits (#3212)--append-system-prompt flags, each value is appended to the system prompt separated by double newlines. See README.md#other-options.main() for embedded integrations and custom entrypoints.super-modified shortcuts such as super+k, super+enter, and ctrl+super+k. See docs/keybindings.md.--append-system-prompt flags, each value is appended to the system prompt separated by double newlines (#3171 by @aliou)super-modified shortcuts such as super+k, super+enter, and ctrl+super+k (#3111 by @sudosubin)main() for embedded integrations and custom entrypoints (#3099 by @pmateusz)prompt_cache_key, session_id, and x-client-request-id values with the same session-derived identifier, improving prompt cache affinity for append-only sessions (#3018 by @steipete)partialJson scratch buffers leaking into persisted OpenAI Responses tool calls, which could corrupt follow-up payloads on resumed conversations.modifyOtherKeys parsing when the legacy form does not match (#2989 by @kaofelix)subagent example to avoid leaking Bun virtual filesystem script paths into subagent prompts (#3002 by @nathyong)Interactive mode now sends a lightweight anonymous install/update telemetry ping to https://pi.dev/install?version=x.y.z after it writes lastChangelogVersion in settings.json.
Why this exists:
How it works:
lastChangelogVersion, then sends the ping.lastChangelogVersion, Pi writes the new lastChangelogVersion, then sends the ping.What data is collected:
https://pi.dev/install?version=0.67.1.{ "0.67.1": 3 }.How to disable it:
/settings → disable Install telemetrysettings.json → set enableInstallTelemetry to falsePI_OFFLINE=1PI_TELEMETRY=0openRouterRouting support in models.json, including fallbacks, parameter requirements, data collection, ZDR, ignore lists, quantizations, provider sorting, max price, and preferred throughput and latency constraints. See docs/models.md.PI_CODING_AGENT=true environment variable set at startup so subprocesses can detect they are running inside the coding agent.antigravity-image-gen.ts example extension to use User-Agent version 1.21.9 (#2901 by @aadishv)--list-models silently swallowing models.json load errors; errors are now printed to stderr (#3072)Fixed custom models for built-in providers (e.g. openrouter) being silently dropped from --list-models by inheriting api/baseUrl from built-in model definitions and no longer requiring apiKey for providers with existing auth (#2921 and #3072)
Added full openRouterRouting field support in models.json, including fallbacks, parameter requirements, data collection, ZDR, ignore lists, quantizations, provider sorting, max price, and preferred throughput and latency constraints (#2904 by @zmberber)
Set PI_CODING_AGENT=true environment variable at startup so sub-processes can detect they are running inside the coding agent (#2868)
### Telemetry heading, so startup shows the full release notes instead of only the version header.antigravity-image-gen.ts example extension to use User-Agent version 1.21.9 (#2901 by @aadishv)1.21.9 (#2901 by @aadishv)MINIMAL and HIGH, and map Pi reasoning levels to the model's supported thinking levels (#2903 by @aadishv)serviceTier values, restoring service-tier selection for Codex sessions (#2996 by @markusylisiurunen)Container.render() stack overflow on long sessions by replacing Array.push(...spread) with a loop-based push, preventing RangeError: Maximum call stack size exceeded when child output exceeds the V8 call stack argument limit (#2651)/tree branch summarization to flush automatically after navigation completes, so they no longer remain stuck in the steering queue (#3091 by @Perlence)npm view instead of hardcoded registry.npmjs.org fetch (#3164 by @aliou)See [0.67.1]. Version 0.67.0 shipped with a changelog formatting error that caused interactive startup to show only the version header instead of the full release notes.
/dementedelves slash command.readline import to use node:readline prefix for Deno compatibility (#2885 by @milosv-vtool)request ended without sending any chunks as transient errors (#2892)fs.watch error events instead of crashing the process (#2791)prompt_tokens_details.cache_write_tokens and normalize OpenRouter cached_tokens, preventing incorrect cache read/write token and cost reporting in pi (#2802)git:gist.github.com/... being incorrectly resolved against cwd instead of being passed through to the package manager (#2845 by @aliou)--mode json to preserve JSONL output instead of falling back to plain text (#2848 by @aliou)/exit as a supported quit command (#2850)createAgentSessionRuntime() and AgentSessionRuntime provide a closure-based runtime that recreates cwd-bound services and session config on every session switch. Startup, /new, /resume, /fork, and import all use the same creation path. See docs/sdk.md and examples/sdk/13-session-runtime.ts./tree: Toggle timestamps on tree entries with Shift+T, with smart date formatting and timestamp preservation through branching (#2691 by @w-winter)defineTool() helper: Create standalone custom tool definitions with full TypeScript parameter type inference, no manual casts needed (#2746). See docs/extensions.md.info/warning/error) instead of logging or exiting. The app layer decides presentation and exit behavior.session_switch and session_fork. Use session_start with event.reason ("startup" | "reload" | "new" | "resume" | "fork"). For "new", "resume", and "fork", session_start includes previousSessionFile.AgentSession. Use AgentSessionRuntime for newSession(), switchSession(), fork(), and importFromJsonl(). Cross-cwd session replacement rebuilds all cwd-bound runtime state and replaces the live AgentSession instance.session_directory from extension and settings APIs.-s) now produce an error instead of being silently ignored.Before:
pi.on("session_switch", async (event, ctx) => { ... });
pi.on("session_fork", async (_event, ctx) => { ... });
After:
pi.on("session_start", async (event, ctx) => {
// event.reason: "startup" | "reload" | "new" | "resume" | "fork"
// event.previousSessionFile: set for "new", "resume", "fork"
});
Before:
await session.newSession();
await session.switchSession("/path/to/session.jsonl");
After:
import {
type CreateAgentSessionRuntimeFactory,
createAgentSessionFromServices,
createAgentSessionRuntime,
createAgentSessionServices,
getAgentDir,
SessionManager,
} from "@mariozechner/pi-coding-agent";
const createRuntime: CreateAgentSessionRuntimeFactory = async ({ cwd, sessionManager, sessionStartEvent }) => {
const services = await createAgentSessionServices({ cwd });
return {
...(await createAgentSessionFromServices({ services, sessionManager, sessionStartEvent })),
services,
diagnostics: services.diagnostics,
};
};
const runtime = await createAgentSessionRuntime(createRuntime, {
cwd: process.cwd(),
agentDir: getAgentDir(),
sessionManager: SessionManager.create(process.cwd()),
});
await runtime.newSession();
await runtime.switchSession("/path/to/session.jsonl");
await runtime.fork("entry-id");
// After replacement, runtime.session is the new live session.
// Rebind any session-local subscriptions or extension bindings.
createAgentSessionRuntime() and AgentSessionRuntime for runtime-backed session replacement. The runtime takes a CreateAgentSessionRuntimeFactory closure that closes over process-global fixed inputs and recreates cwd-bound services and session config for each effective cwd. Startup and later /new, /resume, /fork, import all use the same factory.info/warning/error) for arg parsing, service creation, session option resolution, and resource loading. Creation logic no longer logs or exits. The app layer decides presentation and exit behavior.Added error diagnostics for missing explicit CLI resource paths (-e, --skill, --prompt-template, --theme)
Added defineTool() so standalone and array-based custom tool definitions keep inferred parameter types without manual casts (#2746)
Added label timestamps to the session tree with a Shift+T toggle in /tree, smart date formatting, and timestamp preservation through branching (#2691 by @w-winter)
ResourceLoader for the first runtime, so extensions are not loaded twice before session startup and session_start handlers still fire for singleton-style extensions (#2766)export colors to resolve theme variables the same way as colors, so /export HTML backgrounds now honor entries like pageBg: "base" instead of requiring inline hex values (#2707)prepareArguments hook to any tool definition, letting them normalize or migrate raw model arguments before schema validation. The built-in edit tool uses this to transparently support sessions created with the old single-edit schema. See docs/extensions.mdctx.ui.setHiddenThinkingLabel(). See examples/extensions/hidden-thinking-label.ts (#2673)ModelRegistry no longer has a public constructor. SDK callers and tests must use ModelRegistry.create(authStorage, modelsJsonPath?) for file-backed registries or ModelRegistry.inMemory(authStorage) for built-in-only registries. Direct new ModelRegistry(...) calls no longer compile.ToolDefinition.prepareArguments hook to prepare raw tool call arguments before schema validation, enabling compatibility shims for resumed sessions with outdated tool schemasedit tool now uses prepareArguments to silently fold legacy top-level oldText/newText into edits[] when resuming old sessionsctx.ui.setHiddenThinkingLabel() so extensions can customize the collapsed thinking label in interactive mode, with a no-op in RPC mode and a runnable example extension in examples/extensions/hidden-thinking-label.ts (#2673)tsconfig.json path mappings to resolve @mariozechner/pi-ai subpath exports to source files in development checkouts (#2625 by @ferologics)CSI 6 ; height ; width t replies, so bare Escape is no longer swallowed while waiting for terminal image metadata (#2661)ctx.signal to forward cancellation into nested model calls, fetch(), and other abort-aware work. See docs/extensions.md#ctxsignal (#2660)edit tool input now uses edits[] as the only replacement shape, reducing invalid tool calls caused by mixed single-edit and multi-edit schemas (#2639)ctx.signal to ExtensionContext and wired it to the active agent turn so extension handlers can forward cancellation into nested model calls, fetch(), and other abort-aware work (#2660)edit tool input to use edits[] as the only replacement shape, eliminating the mixed single-edit and multi-edit modes that caused repeated invalid tool calls and retries (#2639)gemini-3.1-pro-preview-customtools model availability for the google-vertex provider (#2610 by @gordonhwc)tool_call input mutation as supported extension API behavior, clarified that post-mutation inputs are not re-validated, and added regression coverage for executing mutated tool arguments (#2611)tokensBefore from the rebuilt session context (#2608)ctx.compact() rebuilds the chat through unified compaction events, manual compaction no longer duplicates the summary block, and the trigger-compact example only fires when context usage crosses its threshold (#2617)SKILL.md, and to ignore root *.md files in .agents/skills while keeping root markdown skill files supported in ~/.pi/agent/skills, .pi/skills, and package skills/ directories (#2603)prompt too long; exceeded max context length ... errors instead of silently truncating input (#2626)renderCall and renderResult renderers in the interactive TUI, restoring the minimal-mode example (#2595)ModelRegistry.getApiKey(model) has been replaced by getApiKeyAndHeaders(model) because models.json auth and header values can now resolve dynamically on every request. Extensions and SDK integrations that previously fetched only an API key must now fetch request auth per call and forward both apiKey and headers. Use getApiKeyForProvider(provider) only when you explicitly want provider-level API key lookup without model headers or authHeader handling (#1835)minimax and minimax-cn model IDs, keeping only MiniMax-M2.7 and MiniMax-M2.7-highspeed. Update pinned model IDs to one of those supported direct MiniMax models, or use another provider route that still exposes the older IDs (#2596 by @liyuan97)Before:
const apiKey = await ctx.modelRegistry.getApiKey(model);
return streamSimple(model, messages, { apiKey });
After:
const auth = await ctx.modelRegistry.getApiKeyAndHeaders(model);
if (!auth.ok) throw new Error(auth.error);
return streamSimple(model, messages, {
apiKey: auth.apiKey,
headers: auth.headers,
});
sessionDir setting support in global and project settings.json so session storage can be configured without passing --session-dir on every invocation (#2598 by @smcllns)edit tool multi-edit support so one call can update multiple separate, disjoint regions in the same file while matching all replacements against the original file contentPI_TUI_WRITE_LOG directory paths, creating a unique log file (tui-<timestamp>-<pid>.log) per instance for easier debugging of multiple pi sessions (#2508 by @mrexodia)edit and write operations targeting the same file stay serialized in request order instead of being reordered during queue-key resolutionmodels.json shell-command auth and headers to resolve at request time instead of being cached into long-lived model state. pi now leaves TTL, caching, and recovery policy to user-provided wrapper commands because arbitrary shell commands need provider-specific strategies (#1835)cachedContentTokenCount (#2588 by @sparkleMing)ajv direct dependency; previously relied on transitive install via @mariozechner/pi-ai which broke standalone installs (#2252)/export HTML backgrounds to honor theme.export.pageBg, cardBg, and infoBg instead of always deriving them from userMessageBg (#2565)get_session_stats to expose contextUsage, so headless clients can read actual current context-window usage instead of deriving it from token totals (#2550)pi update for git packages to fetch only the tracked target branch with --no-tags, reducing unrelated branch and tag noise while preserving force-push-safe updates (#2548)session_shutdown before exit, so extensions can release long-lived resources and non-interactive runs terminate cleanly (#2576)reasoning field entirely when no reasoning effort is requested, avoiding 400 errors from Copilot gpt-5-mini rejecting reasoning: { effort: "none" } during internal summary calls (#2567)/model that submit into a selector dialog (#2577)@ autocomplete to debounce editor-triggered searches, cancel in-flight fd lookups cleanly, and keep suggestions visible while results refresh (#1278)renderCall/renderResult components. See docs/extensions.md.sourceInfo. All resources, commands, tools, skills, and prompt templates now carry structured sourceInfo with path, scope, and source metadata. Visible in autocomplete, RPC discovery, and SDK introspection. See docs/extensions.md.requestMetadata option on BedrockOptions forwards key-value pairs to the Bedrock Converse API for AWS Cost Explorer split cost allocation.ToolDefinition.renderCall and renderResult semantics. Fallback rendering now happens only when a renderer is not defined for that slot. If renderCall or renderResult is defined, it must return a Component.sourceInfo consistently. RPC get_commands, RpcSlashCommand, and SDK SlashCommandInfo no longer expose location or path. Use sourceInfo instead (#1734)source fields from Skill and PromptTemplate. Use sourceInfo.source for provenance instead (#1734)ResourceLoader.getPathMetadata(). Resource provenance is now attached directly to loaded resources via sourceInfo (#1734)extensionPath from RegisteredCommand and RegisteredTool. Use sourceInfo.path for provenance instead (#1734)Resource, command, and tool provenance now use sourceInfo consistently.
Common updates:
get_commands: replace path and location with sourceInfo.path, sourceInfo.scope, and sourceInfo.sourceSlashCommandInfo: replace command.path and command.location with command.sourceInfoSkill and PromptTemplate: replace .source with .sourceInfo.sourceRegisteredCommand and RegisteredTool: replace .extensionPath with .sourceInfo.pathResourceLoader implementations: remove getPathMetadata() and read provenance from loaded resources directlyExamples:
command.path -> command.sourceInfo.pathcommand.location === "user" -> command.sourceInfo.scope === "user"skill.source -> skill.sourceInfo.sourcetool.extensionPath -> tool.sourceInfo.pathreadToolDefinition / createReadToolDefinition() and the equivalent bash, edit, write, grep, find, and ls exports from @mariozechner/pi-coding-agent.buildSystemPrompt() so built-in tool snippets and tool-local guidelines come from built-in ToolDefinition metadata, while cross-tool and global prompt rules stay in system prompt construction.sourceInfo to pi.getAllTools() results for built-in, SDK, and extension tools (#1734)/review:1 and /review:2 (#1061)read and @file auto-resize paths (#2055)pi update for git packages to skip destructive reset, clean, and reinstall steps when the fetched target already matches the local checkout (#2503)thinking: { type: "disabled" } for reasoning-capable models when thinking is explicitly off (#2022)fc_<hash> IDstruncateToWidth() performance for very large strings by streaming truncation (#2447)tool_call handler return values via ToolCallEventResult exports from the top-level package and core extension entry. See docs/extensions.md.zai, cerebras, minimax, and minimax-cn, and aligned MiniMax catalog coverage and limits with the current provider lineup. See docs/models.md and docs/providers.md.ToolCallEventResult to the @mariozechner/pi-coding-agent top-level and core extension exports so extension authors can type explicit tool_call handler return values (#2458)zai, cerebras, minimax, and minimax-cn to match the current provider lineup, and added missing MiniMax-M2.1-highspeed model entries with normalized MiniMax context limits (#2445 by @1500256797)ctrl+z suspend and fg resume reliability by keeping the process alive until the SIGCONT handler restores the TUI, avoiding immediate process exit in environments with no other live event-loop handles (#2454)createAgentSession({ agentDir }) to derive the default persisted session path from the provided agentDir, keeping session storage aligned with settings, auth, models, and resource loading (#2457)latest instead of reusing stale saved dependency ranges, and added Did you mean ...? suggestions when pi update <source> omits the configured npm or git source prefix (#2459)/export <path.jsonl> and /import <path.jsonl>. See README.md and docs/session.md.keybindings.json now uses those same canonical namespaced ids. Older config files are migrated automatically on startup. Custom editors and extension UI components still receive an injected keybindings: KeybindingsManager. They do not call getKeybindings() or setKeybindings() themselves. Declaration merging applies to that injected type (#2391)keyHint(), keyText(), and injected keybindings.matches(...) calls from old built-in names like "expandTools", "selectConfirm", and "interrupt" to namespaced ids like "app.tools.expand", "tui.select.confirm", and "app.interrupt". See docs/keybindings.md for the full list. pi.registerShortcut("ctrl+shift+p", ...) is unchanged because extension shortcuts still use raw key combos, not keybinding ids.gpt-5.4-mini to the openai-codex model catalog (#2334 by @justram)/export <path.jsonl> and /import <path.jsonl> (#2356 by @hjanuschka)keybindings.json cannot cause failures (#2360)keybindings.json overrides to shadow conflicting default shortcuts globally, so bindings such as cursorUp: ["up", "ctrl+p"] no longer leave default actions like model cycling active (#2391)edit and write mutations targeting the same file to run serially, preventing interleaved file writes from overwriting each other (#2327)session.prompt() waits for the full retry loop, including tool execution, before returning (#2440 by @pasky)/model to refresh scoped model lists after models.json changes, avoiding stale selector contents (#2408 by @Perlence)validateToolArguments() to fall back gracefully when AJV schema compilation is blocked in restricted runtimes such as Cloudflare Workers, allowing tool execution to proceed without schema validation (#2395)agent-browser and similar commands to spin forever (#2389 by @mrexodia)google-vertex API key resolution to ignore placeholder auth markers like <authenticated> and fall back to ADC instead of sending them as literal API keys (#2335)AWS_BEDROCK_FORCE_CACHE=1 is set, covering profile ARNs that do not expose the underlying Claude model name (#2346 by @haoqixu)--fork <path|id>, which copies a source session into a new session in the current project. See README.md.createLocalBashOperations() for user_bash interception and custom bash integrations. See docs/extensions.md#user_bash.pi update explicitly, while interactive mode checks for updates in the background and notifies you when newer packages are available. See README.md.pi update to apply npm/git package updates, while interactive mode now checks for available package updates in the background and notifies you when updates are available (#1963)--fork <path|id> CLI flag to fork an existing session file or partial session UUID directly into a new session (#2290)createLocalBashOperations() export so extensions and SDK callers can wrap pi's built-in local bash backend for user_bash handling and other custom bash integrations (#2299)modifyOtherKeys matching for Backspace, Escape, and Space, and resolved raw \x08 backspace ambiguity by treating Windows Terminal sessions differently from legacy terminals (#2293)/reload to reload keybindings from disk so changes in keybindings.json apply immediately (#2309)network_error responses to trigger error handling and retries instead of being treated as successful assistant output (#2313)@mariozechner/pi-ai provider SDKs on first use instead of import time (#2297)Available tools section only when they provide promptSnippet. Omitting promptSnippet now leaves the tool out of that section instead of falling back to description (#2285)@mariozechner/pi-ai provider modules and root provider wrappers so coding-agent startup no longer eagerly loads provider SDKs before first use (#2297)/tree, compaction, and branch summarization so empty title clears render correctly and session_info entries stay out of summaries (#2304 by @aliou)edit matching to normalize Unicode compatibility variants before comparison, reducing false "oldText not found" failures for text such as CJK and full-width characters (#2044)/model <ref> exact matching and picker search to recognize canonical provider/model references when model IDs themselves contain /, such as LM Studio models like unsloth/qwen3.5-35b-a3b (#2174)scope from refresh-token requests (#2169)pi uninstall alias for pi install --uninstall conveniencesession_start hook firing before TUI was ready, causing UI operations in session_start handlers to fail (#2035)qwen-chat-template compat mode that uses Qwen's native chat template format (#2020)models.json provider compat flags not being honored when loading custom model definitions (#2062)./ prefix when completing relative paths (#2087)npmCommand as an argv-style settings override for package manager operations (#2072)ctx.ui.getEditorText() in the extension API returning paste markers (e.g., [paste #1 +24 lines]) instead of the actual pasted content (#2084)fd/ripgrep on first run by using pipeline() instead of finished(readable.pipe(writable)) so stream errors from timeouts are caught properly, and increased the download timeout from 10s to 120s (#2066)tool_call preflight preserved for extension interception.GOOGLE_CLOUD_API_KEY environment variable support for the google-vertex provider as an alternative to Application Default Credentials (#1976 by @gordonhwc).newSession() (#2130 by @zhahaoyu).GOOGLE_CLOUD_API_KEY environment variable support for the google-vertex provider as an alternative to Application Default Credentials (#1976 by @gordonhwc)newSession() for extensions that need deterministic session paths (#2130 by @zhahaoyu)beforeToolCall and afterToolCall hooks instead of wrapper-based interception. Tool calls now execute in parallel by default, extension tool_call preflight still runs sequentially, and final tool results are emitted in assistant source order.tool_call extension handlers observing stale sessionManager state during multi-tool turns by draining queued agent events before each tool_call preflight. In parallel tool mode this guarantees state through the current assistant tool-calling message, but not sibling tool results from the same assistant message.Input component to scroll by visual column width for wide Unicode text (CJK, fullwidth characters), preventing rendered line overflow and TUI crashes in places like search and filter inputs (#1982)shift+tab and other modified Tab bindings in tmux when extended-keys-format is left at the default xtermserver_error and internal_error error types from providers, improving automatic retry coverage (#2117 by @MadKangYu)PI_CODING_AGENT_DIR environment variable for custom agent directory paths (#2009 by @smithbm2316)function_call_output items for OpenAI Responses API providers, causing image data to be silently dropped in tool results (#2104)openai-completions provider, causing errors with some OpenAI-compatible backends (#2008 by @geraldoaax)response.failed handler to include status code, error code, and message instead of a generic failure (#1956 by @drewburr)choice.usage instead of the standard chunk.usage (e.g., Moonshot/Kimi) (#2017)wordWrapLine overflow when wide characters (CJK, fullwidth) fall exactly at the wrap boundary (#2082 by @haoqixu)/tree, with Ctrl+←/Ctrl+→ and Alt+←/Alt+→ shortcuts while ←/→ and Page Up/Page Down remain available for paging. See docs/tree.md and docs/keybindings.md.session_directory extension event for customizing session directory paths before session manager creation. See docs/extensions.md.0-9) in the TUI keybinding system, including modified combos like ctrl+1. See docs/keybindings.md./tree branch folding and segment-jump navigation with Ctrl+←/Ctrl+→ and Alt+←/Alt+→, while keeping ←/→ and Page Up/Page Down for paging (#1724 by @Perlence)session_directory extension event that fires before session manager creation, allowing extensions to customize the session directory path based on cwd and other factors. CLI --session-dir flag takes precedence over extension-provided paths (#1730 by @hjanuschka).0-9) to the keybinding system, including Kitty CSI-u and xterm modifyOtherKeys support for bindings like ctrl+1 (#1905)shift+enter=text:\n remap guidance and tmux extended-keys-format detection (#1872)model_context_window_exceeded errors trigger auto-compaction instead of surfacing as unhandled stop reason failures (#1937)pi -e <path> extensions losing command and tool conflicts to discovered extensions by giving CLI-loaded extensions higher precedence (#1896)Ctrl+G and ctx.ui.editor() so shell-based commands like EDITOR="code --wait" work correctly (#1925)before_provider_request. See docs/extensions.md#before_provider_request.OverlayOptions.nonCapturing and OverlayHandle.focus() / unfocus() / isFocused(). See docs/extensions.md and ../tui/README.md.\n only instead of using generic line readers such as Node readline, which also split on Unicode separators inside JSON payloads (#1911)before_provider_request extension hook so extensions can inspect or replace provider payloads before requests are sent, with an example in examples/extensions/provider-payload.tsOverlayOptions.nonCapturing and OverlayHandle.focus() / unfocus() / isFocused() (#1916 by @nicobailon)readline, so payloads containing U+2028 or U+2029 no longer corrupt command or event streams (#1911)pi config misclassifying ~/.agents/skills as project-scoped in non-git directories under $HOME, so toggling those skills no longer writes project overrides to .pi/settings.json (#1915)claude-sonnet-4-6 model available via the google-antigravity provider (#1859)onEscape/onCtrlD handlers without being overwritten by app defaults, enabling vim-mode extensions (#1838)claude-sonnet-4-6 model for the google-antigravity provider (#1859).onEscape/onCtrlD handlers unconditionally overwritten by app-level defaults, making vim-style escape handling impossible (#1838)/new leaving startup header content, including the changelog, visible after starting a fresh session (#1880){ isError: true } from a tool's execute function marks the execution as failed; errors must be signaled by throwing (#1881)off clamp (#1864)auth.json and settings.json (#1871)openai, openai-codex, azure-openai-responses, and opencode, with gpt-5.4 now the default for openai and openai-codex (README.md, docs/providers.md).treeFilterMode setting to choose the default /tree filter mode (default, no-tools, user-only, labeled-only, all) (docs/settings.md, #1852 by @lajarre).gpt-5.4 model availability for openai, openai-codex, azure-openai-responses, and opencode providers.gpt-5.3-codex fallback model availability for github-copilot until upstream model catalogs include it (#1853).treeFilterMode setting to choose the default /tree filter mode (default, no-tools, user-only, labeled-only, all) (#1852 by @lajarre).openai and openai-codex providers to gpt-5.4.phase metadata by preserving replayable signatures in session history and forwarding phase back to the Responses API (#1819).@mariozechner/pi-ai/oauth extension imports in published installs by resolving the subpath directly from built dist files instead of package-root wrapper shims (#1856).skip_thought_signature_validator sentinel for unsigned function calls instead of text fallback (#1829).Input component (#1857)\r\n) to LF for display rendering in tool output previews (#1854).jiti aliases in global installs (#1821 by @Perlence)opencode-go model defaults and OPENCODE_API_KEY environment variable support (docs/providers.md, #1757).branchSummary.skipPrompt setting to skip branch summarization prompts during tree navigation (docs/settings.md, #1792).gemini-3.1-flash-lite-preview fallback model availability for Google provider catalogs when upstream model metadata lags (README.md, #1785).:<thinking> suffix now inherit the current session thinking level when selected, instead of applying a startup-captured default.@mariozechner/pi-ai entry. OAuth login and refresh must be imported from @mariozechner/pi-ai/oauth (#1814).branchSummary.skipPrompt setting to skip the summary prompt when navigating branches (#1792).opencode-go model defaults and OPENCODE_API_KEY environment variable support (#1757).gemini-3.1-flash-lite-preview fallback model availability in provider catalogs when upstream catalogs lag (#1785).ctx.ui.editor() / extension editor dialog) by propagating focus to the internal Editor, preventing the terminal cursor from getting stuck at the bottom-right during composition.@ autocomplete scans on large pastes (#1812).@mariozechner/pi-ai/oauth export path by aliasing the oauth subpath in the extension loader and development path mapping (#1814).screen* TERM values (#1809).models.json to allow provider-scoped custom model ids and model-level baseUrl overrides (#1759, #1777).AWS_PROFILE region resolution by honoring profile region values (#1800).google and google-vertex providers (#1785).Fixed browser bundling compatibility for @mariozechner/pi-ai by removing Node-only side effects from default browser import paths (#1814).
pi.registerTool() after startup are available to pi.getAllTools() and the LLM without /reload (docs/extensions.md, examples/extensions/dynamic-tools.ts, #1720).promptSnippet (Available tools) and promptGuidelines (Guidelines) while the tool is active (docs/extensions.md, #1720).promptSnippet to ToolDefinition for one-line entries in the default system prompt's Available tools section. Active extension tools appear there when registered and active (#1237 by @semtexzv).promptGuidelines to ToolDefinition so active tools can append tool-specific bullets to the default system prompt Guidelines section (#1720).pi.registerTool() dynamic registration after session initialization. Tools registered in session_start and later handlers now refresh immediately, become active, and are visible to the LLM without /reload (#1720)AgentSession event processing, preventing toolResult entries from being written before their corresponding assistant tool-call messages when extension handlers are asynchronous (#1717)session.prompt() returning before retry completion by creating the retry promise synchronously at agent_end dispatch, which closes a race when earlier queued event handlers are async (#1726 by @pasky)alt+v to avoid ctrl+v conflicts with terminal paste behavior (#1682 by @mrexodia).pi.unregisterProvider(name), restoring any built-in models that were overridden, without requiring /reload (docs).pi.registerProvider() now takes effect immediately when called outside the initial extension load phase (e.g. from a command handler), removing the need for /reload after late registrations.pi.unregisterProvider(name) removes a dynamically registered provider and its models from the registry without requiring /reload. Built-in models that were overridden by the provider are restored (#1669 by @aliou).pi.registerProvider() now takes effect immediately when called after the initial extension load phase (e.g. from a command handler). Previously the registration sat in a pending queue that was never flushed until the next /reload (#1669 by @aliou).createBranchedSession now defers file creation to _persist() when the branched path has no assistant message, matching the newSession() contract (#1672 by @w-winter).ctrl+z), which could corrupt terminal state on resume (#1668 by @aliou).redacted_thinking blocks being silently dropped during Anthropic streaming, and related issues with interleaved-thinking beta headers and temperature being sent alongside extended thinking (#1665 by @tctev)(external, cli) user-agent flag causing 401 errors on Anthropic setup-token endpoint (#1677 by @LazerLance777)choices array (#1671)--offline (or PI_OFFLINE) to disable startup network operations, with startup network timeouts to avoid hangs in restricted or offline environments.gemini-3.1-pro-preview model support to the google-gemini-cli provider (#1599 by @audichuang).fd/rg bootstrap on Windows in Git Bash by using extract-zip for .zip archives, searching extracted layouts more robustly, and isolating extraction temp directories to avoid concurrent download races (#1348)@sinclair/typebox aliases so subpath imports like @sinclair/typebox/compiler resolve correctly.xhigh effort values to supported levels (#1548 by @tctev)cwd/.pi) before user-global (~/.pi/agent). If you relied on global resources overriding project resources with the same names, rename or reorder your resources..pi folder being created unnecessarily when only reading settings. The folder is now only created when writing project-specific settings./settings reflects the active currentTheme after ctx.ui.setTheme(...) (#1483 by @ferologics)write tool calls by using incremental syntax highlighting while partial arguments stream, with a final full re-highlight after tool-call arguments complete..node file is now shipped alongside the Windows binary only..agents/skills locations. Pi now discovers project skills from .agents/skills in cwd and ancestor directories (up to git repo root, or filesystem root when not in a repo), and global skills from ~/.agents/skills, in addition to existing .pi skill paths.google, google-vertex, opencode, openrouter, and vercel-ai-gateway.google-antigravity model catalog.SettingsManager persistence semantics changed for SDK consumers. Setters now update in-memory state immediately and queue disk writes. Code that requires durable on-disk settings must call await settingsManager.flush().AuthStorage constructor is no longer public. Use static factories (AuthStorage.create(...), AuthStorage.fromStorage(...), AuthStorage.inMemory(...)). This breaks code that used new AuthStorage(...) directly.SettingsManager.drainErrors() for caller-controlled settings I/O error handling without manager-side console output.FileAuthStorageBackend, InMemoryAuthStorageBackend) and AuthStorage.fromStorage(...) for storage-first auth persistence wiring.claude-sonnet-4-6 model fallback entry to generated model definitions.SettingsManager now uses scoped storage abstraction with per-scope locked read/merge/write persistence for global and project settings.auth.json via locked read/merge/write updates.AuthStorage.drainErrors().transport setting ("sse", "websocket", "auto") to /settings and settings.json for providers that support multiple transports (currently openai-codex via OpenAI Codex Responses).websockets: boolean to the new transport setting.minimax, minimax-cn, openrouter, and vercel-ai-gateway providers, plus minimax-m2.5-free for opencode.terminal_input, allowing extensions to consume or transform raw input before normal TUI handling. See docs/extensions.md.--model now supports provider/id, fuzzy matching, and :<thinking> suffixes. See README.md and docs/models.md.gpt-5.3-codex-spark for OpenAI and OpenAI Codex providers.ContextUsage.tokens and ContextUsage.percent are now number | null. After compaction, context token count is unknown until the next LLM response, so these fields return null. Extensions that read ContextUsage must handle the null case. Removed usageTokens, trailingTokens, and lastUsageIndex fields from ContextUsage (implementation details that should not have been public) (#1382 by @ferologics)git: prefix: only protocol URLs are treated as git (https://, http://, ssh://, git://). Shorthand sources like github.com/org/repo and git@github.com:org/repo now require the git: prefix. (#1426)message_start, message_update, message_end, tool_execution_start, tool_execution_update, tool_execution_end) (#1375 by @sumeet)terminal_input extension event to intercept, consume, or transform raw terminal input before normal TUI handling.gpt-5.3-codex-spark model definition for OpenAI and OpenAI Codex providers (research preview).?/200k until the next LLM response provides accurate usage (#1382 by @ferologics)_checkCompaction() using the first compaction entry instead of the latest, which could cause incorrect overflow detection with multiple compactions (#1382 by @ferologics)--model now works without --provider, supports provider/id syntax, fuzzy matching, and :<thinking> suffix (e.g., --model sonnet:high, --model openai/gpt-4o) (#1350 by @mitsuhiko)fd installation (#1433)@ file autocomplete fuzzy matching to prioritize path-prefix and segment matches for nested paths (#1423)ctx.reload(), useful for hot-reloading configuration or restarting the agent. See docs/extensions.md and the reload-runtime example (#1371)-ne (--no-extensions), -ns (--no-skills), and -np (--no-prompt-templates) for faster interactive usage and scripting./export HTML now includes collapsible tool input schemas (parameter names, types, and descriptions), improving session review and sharing workflows (#1416 by @marchellodev).pi.getAllTools() now exposes tool parameters in addition to name and description, enabling richer extension integrations (#1416 by @marchellodev).ctx.reload() to the extension API for programmatic runtime reload (#1371)-ne for --no-extensions, -ns for --no-skills, -np for --no-prompt-templates/export HTML now includes tool input schema (parameter names, types, descriptions) in a collapsible section under each tool (#1416 by @marchellodev)pi.getAllTools() now returns tool parameters in addition to name and description (#1416 by @marchellodev).pi/extensions/foo.ts) are treated as local paths instead of git URLsunzip not being available; now uses tar for both .tar.gz and .zip extraction, with proper error reporting (#1348)ctx.hasUI is false; it is true because dialog and fire-and-forget UI methods work via the RPC sub-protocol. Also documented missing unsupported/degraded methods (pasteToEditor, getAllThemes, getTheme, setTheme) (#1411 by @aliou)rg not available in bash tool by downloading it at startup alongside fd (#1348)custom-compaction example to use ModelRegistry (#1387)claude-opus-4-6-thinking back to claude-opus-4-5-thinking (model does not exist on Antigravity endpoint)ctrl+k/ctrl+y/alt+y) and undo (ctrl+z) in the editor input (#1373 by @Perlence)auto model alias (openrouter:auto) for automatic model routing (#1361 by @yogasanas)pasteToEditor in the extension UI context. See docs/extensions.md (#1351 by @kaofelix)pi <package> --help and invalid subcommands now show helpful output instead of failing silently (#1347 by @ferologics)pasteToEditor to extension UI context for programmatic editor paste (#1351 by @kaofelix)auto model alias for automatic model routing (#1361 by @yogasanas)-e <git-url>) to refresh on cache hits for unpinned sources, including detached/no-upstream checkoutsmodels.json via modelOverrides, allowing customization of built-in provider models without replacing provider model lists. See docs/models.md#per-model-overrides.models.json provider models now merge with built-in models by id, so custom models can be added or replace matching built-ins without full provider replacement. See docs/models.md#overriding-built-in-providers.AWS_BEDROCK_SKIP_AUTH and AWS_BEDROCK_FORCE_HTTP1. See docs/providers.md.models.json provider models behavior from full replacement to merge-by-id with built-in models. Built-in models are now kept by default, and custom models upsert by id.modelOverrides in models.json to customize individual built-in models per provider without full provider replacement (#1332 by @charles-cooper)AWS_BEDROCK_SKIP_AUTH and AWS_BEDROCK_FORCE_HTTP1 environment variables for connecting to unauthenticated Bedrock proxies (#1320 by @virtuald)tool_result extension handlers to chain result patches across handlers instead of last-handler-wins behavior (#1280)store: false by default to avoid server-side history logging (#1308)modelOverrides merge behavior for nested objects and documented usage details (#1062)/exit command handling. Use /quit to exit (#1303)/quit being shadowed by fuzzy slash command autocomplete matches from skills by adding /quit to built-in command autocomplete (#1303)xhigh in selectors and cyclingpackage.json pi.extensions manifest when directory is specified directly (#1302 by @hjanuschka)git:github.tools.sap/org/repo are treated as git packages instead of local paths@ref parsing for shorthand, HTTPS, and SSH source formats, including branch refs with slashesus.anthropic.claude-opus-4-6-v1:0 to us.anthropic.claude-opus-4-6-v1anthropic provider to claude-opus-4-6openai-codex provider to gpt-5.3-codexamazon-bedrock provider to us.anthropic.claude-opus-4-6-v1:0vercel-ai-gateway provider to anthropic/claude-opus-4-6opencode provider to claude-opus-4-6auth.json API keys now support shell command resolution (!command) and environment variable lookup. See docs/providers.md.auth.json now support shell command resolution (!command) and environment variable lookup, matching the behavior in models.jsonminimal-mode.ts example extension demonstrating how to override built-in tool rendering for a minimal display modeprompt() is called with both images and streamingBehavior during streaming. steer(), followUp(), and the corresponding RPC commands now accept optional images. (#1271 by @aliou)--help, --version, --list-models, and --export now exit even if extensions keep the event loop alive (#1285 by @ferologics)resume as a configurable keybinding action, allowing users to bind a key to open the session resume selector (like newSession, tree, and fork) (#1249 by @juanibiapina)/reload not picking up changes in global settings.json (#1241)/settings crashing in narrow terminals by handling small widths in the settings list (#1246 by @haoqixu)/bin/bash is unavailable, including Termux setups (#1230 by @VaclavSynacek).cmd resolution (#1220)ExtensionAPI.getCommands(), with commands.ts example for invocation patterns. See docs/extensions.md#pigetcommands and examples/extensions/commands.ts.pi install and pi remove, with relative path resolution against the settings file. See docs/packages.md#local-paths.get_commands response and SlashCommandSource type: renamed "template" to "prompt" for consistency with the rest of the codebaseExtensionAPI.getCommands() to let extensions list available slash commands (extensions, prompt templates, skills) for invocation via prompt (#1210 by @w-winter)commands.ts example extension and exported SlashCommandInfo types for command discovery integrations (#1210 by @w-winter)pi install and pi remove with relative paths stored against the target settings file (#1216)npm.cmd when npm is not directly executable (#1220)ctx.switchSession(sessionPath). See docs/extensions.md. (#1187)terminal.clearOnShrink setting keeps the editor and footer pinned to the bottom of the terminal when content shrinks. May cause some flicker due to redraws. Disabled by default. Enable via /settings or PI_CLEAR_ON_SHRINK=1 env var.Extension tool signature change: ToolDefinition.execute now uses (toolCallId, params, signal, onUpdate, ctx) parameter order to match AgentTool.execute. Previously it was (toolCallId, params, onUpdate, ctx, signal). This makes wrapping built-in tools trivial since the first four parameters now align. Update your extensions by swapping the signal and onUpdate parameters:
// Before
async execute(toolCallId, params, onUpdate, ctx, signal) { ... }
// After
async execute(toolCallId, params, signal, onUpdate, ctx) { ... }
Android/Termux support: Pi now runs on Android via Termux. Install with:
pkg install nodejs termux-api git
npm install -g @mariozechner/pi-coding-agent
mkdir -p ~/.pi/agent
echo "You are running on Android in Termux." > ~/.pi/agent/AGENTS.md
Clipboard operations fall back gracefully when termux-api is unavailable. (#1164)
Bash spawn hook: Extensions can now intercept and modify bash commands before execution via pi.setBashSpawnHook(). Adjust the command string, working directory, or environment variables. See docs/extensions.md. (#1160 by @mitsuhiko)
Linux ARM64 musl support: Pi now runs on Alpine Linux ARM64 (linux-arm64-musl) via updated clipboard dependency.
Nix/Guix support: PI_PACKAGE_DIR environment variable overrides the package path for content-addressed package managers where store paths tokenize poorly. See README.md#environment-variables. (#1153 by @odysseus0)
Named session filter: /resume picker now supports filtering to show only named sessions via Ctrl+N. Configurable via toggleSessionNamedFilter keybinding. See docs/keybindings.md. (#1128 by @w-winter)
Typed tool call events: Extension developers can narrow ToolCallEvent types using isToolCallEventType() for better TypeScript support. See docs/extensions.md#tool-call-events. (#1147 by @giuseppeg)
Extension UI Protocol: Full RPC documentation and examples for extension dialogs and notifications, enabling headless clients to support interactive extensions. See docs/rpc.md#extension-ui-protocol. (#1144 by @aliou)
ToolCallEvent.input per tool with isToolCallEventType() type guard for narrowing built-in tool events (#1147 by @giuseppeg)discoverAndLoadExtensions from package to enable extension testing without a local repo clone (#1148)rpc-demo.ts example extension exercising all RPC-supported extension UI methods (#1144 by @aliou)rpc-extension-ui.ts TUI example client demonstrating the extension UI protocol with interactive dialogs (#1144 by @aliou)PI_PACKAGE_DIR environment variable to override package path for content-addressed package managers (Nix, Guix) where store paths tokenize poorly (#1153 by @odysseus0)/resume session picker now supports named-only filter toggle (default Ctrl+N, configurable via toggleSessionNamedFilter) to show only named sessions (#1128 by @w-winter)pi update not updating npm/git packages when called without arguments (#1151)models.json validation requiring fields documented as optional. Model definitions now only require id; all other fields (name, reasoning, input, cost, contextWindow, maxTokens) have sensible defaults. (#1146)cacheRetention option not being passed through in buildBaseOptions (#1154)HTTP_PROXY, HTTPS_PROXY env vars) (#1132)pi update <source> installing packages locally when the source is only registered globally (#1163 by @aliou)titlebar-spinner.ts example extension that shows a braille spinner animation in the terminal title while the agent is working.PI_AI_ANTIGRAVITY_VERSION environment variable documentation to help text (#1129)cacheRetention stream option with provider-specific mappings for prompt cache controls, defaulting to short retention (#1134)newSession, tree, and fork keybinding actions for /new, /tree, and /fork commands. All unbound by default. (#1114 by @juanibiapina)retry.maxDelayMs setting to cap maximum server-requested retry delay. When a provider requests a longer delay (e.g., Google's "quota will reset after 5h"), the request fails immediately with an informative error instead of waiting silently. Default: 60000ms (60 seconds). (#1123)/resume session picker: new "Threaded" sort mode (now default) displays sessions in a tree structure based on fork relationships. Compact one-line format with message count and age on the right. (#1124 by @pasky)modifyModels hook support for extension-registered providers at registration time. (#940 by @4h9fbZ)enable_thinking. (#940 by @4h9fbZ)resources_discover extension hook to supply additional skills, prompts, and themes on startup and reload.switchSession() appending spurious thinking_level_change entry to session log on resume. setThinkingLevel() is now idempotent. (#1118)image/bmp format. BMP images are now converted to PNG before saving. (#1112 by @lightningRalf)index.ts (or manifest-declared entries) are loaded from subdirectories, not helper modules. (#1102)ctx.getSystemPrompt() to extension context for accessing the current effective system prompt (#1098 by @kaofelix)/tree, clearing multi-line editor) (#1095 by @marckrenn)stop() when a render was pending (#1099 by @haoqixu)/copy command now works over remote connections using the OSC 52 terminal escape sequence. No more clipboard frustration when using pi over SSH. (#1069 by @gturkoglu)vercelGatewayRouting in models.json. (#1051 by @ben-vargas)set_session_name RPC command - Headless clients can now set the session display name programmatically. (#1075 by @dnouri)"none" option for doubleEscapeAction setting completely disables the double-escape shortcut. (#973 by @juanibiapina)doubleEscapeAction setting to disable double-escape behavior entirely (#973 by @juanibiapina)/copy now works over remote connections. (#1069 by @gturkoglu)vercelGatewayRouting in models.json (#1051 by @ben-vargas)set_session_name RPC command for headless clients to set session display name (#1075 by @dnouri)KIMI_API_KEY environment variable. See README.md#kimi-for-coding.KIMI_API_KEY environment variable. See README.md#kimi-for-coding.HF_TOKEN environment variable. See README.md#hugging-face.PI_CACHE_RETENTION=long enables 1-hour caching for Anthropic (vs 5min default) and 24-hour for OpenAI (vs in-memory default). Only applies to direct API calls. See README.md#prompt-caching.autocompleteMaxVisible setting (3-20 items, default 5) controls dropdown size. Adjust via /settings or settings.json.alt+b/alt+f for word navigation, ctrl+d for delete character forward. See docs/keybindings.md.get_commands: Headless clients can now list available commands programmatically. See docs/rpc.md.PI_CACHE_RETENTION environment variable to control cache TTL for Anthropic (5m vs 1h) and OpenAI (in-memory vs 24h). Set to long for extended retention. (#967)autocompleteMaxVisible setting for configurable autocomplete dropdown height (3-20 items, default 5) (#972 by @masonc15)/files command to list all file operations (read, write, edit) in the current sessionalt+b/alt+f for word navigation, ctrl+d for delete character forward (when editor has text) (#1043 by @jasonish)get_commands RPC method for headless clients to list available commands (#995 by @dnouri)extractCursorPosition performance in TUI: scans lines in reverse order, early-outs when cursor is above viewport (#1004 by @can1357)settings.json are now preserved when pi reloads or saves unrelated settings. Previously, editing settings.json directly (e.g., removing a package from packages array) would be silently reverted on next pi startup when automatic setters like setLastChangelogVersion() triggered a save.quietStartup enabled (#1039 by @tudoroancea).md file names in warning messages (#1041 by @llimllib)toolChoice handling (#998 by @williamtwomey)sensitive stop_reason returned by API (#978)deepseek.com URLs and disabling unsupported developer role (#1048)message_delta events (#1045)autocompleteMaxVisible setting not persisting to settings.jsonctx.newSession({ setup }) now properly syncs agent state and renders messages after setup callback runs (#968)/reload/hotkeys output to title-case extension hotkeys (#969 by @Perlence)/reload) of resources including AGENTS.md, SYSTEM.md, APPEND_SYSTEM.md, prompt templates, skills, themes, and extensions. See README.md#commands and README.md#context-files.pi.registerProvider() for proxies, custom endpoints, OAuth or SSO flows, and non-standard streaming APIs. See docs/custom-provider.md.openRouterRouting. See docs/providers.md#api-keys and docs/models.md.disable-model-invocation. See docs/skills.md#frontmatter.models.json headers can resolve environment variables and shell commands. See docs/models.md#value-resolution.--verbose CLI flag to override quiet startup. See README.md#cli-reference.Read the fully revamped docs in README.md, or have your clanker read them for you.
There are multiple SDK breaking changes since v0.49.3. For the quickest migration, point your agent at packages/coding-agent/docs/sdk.md, the SDK examples in packages/coding-agent/examples/sdk, and the SDK source in packages/coding-agent/src/core/sdk.ts and related modules.
models.json now resolve environment variables (if a header value matches an env var name, the env var value is used). This may change behavior if a literal header value accidentally matches an env var name. (#909)packages array in settings.json instead of extensions. Existing npm:/git: entries in extensions are auto-migrated. (#645)ResourceLoader only and settings.json uses arrays for extensions, skills, prompts, and themes (#645)discoverAuthStorage and discoverModels from the SDK. AuthStorage and ModelRegistry now default to ~/.pi/agent paths unless you pass an agentDir (#645)/resume picker via Ctrl+R without opening the session (#863 by @svkozak)disable-model-invocation frontmatter field for skills to prevent agentic invocation while still allowing explicit /skill:name commands (#927)copyToClipboard utility for extensions (#926 by @mitsuhiko)models.json now support environment variables and shell commands, matching apiKey resolution (#909)openRouterRouting compat field (#859 by @v01dpr1mr0s3)azure-openai-responses provider support for Azure OpenAI Responses API. (#890 by @markusylisiurunen)--verbose CLI flag to override quietStartup setting (#906 by @Perlence)markdown.codeBlockIndent setting to customize code block indentation in rendered outputpi install, pi remove, pi update, and pi list commands (#645)packages array (#645)"!funky.json", "*.ts") (#645)/reload command to reload extensions, skills, prompts, and themes (#645)pi config command with TUI to enable/disable package and top-level resources via patterns (#938)--skill, --prompt-template, --theme, --no-prompt-templates, and --no-themes (#645)ResourceDiagnostic type for all resource types (#645)pi.registerProvider() with streamSimple for custom API implementationscustom-provider.ts example extension demonstrating custom Anthropic provider with OAuth/resume picker sort toggle moved to Ctrl+S to free Ctrl+R for rename (#863 by @svkozak)/reload now re-renders the entire scrollback so updated extension components are visible immediately (#928 by @ferologics)setWorkingMessage() calls in agent_start handlers now work correctly; previously the message was silently ignored because the loading animation didn't exist yet (#935)/export (#946 by @mitsuhiko)findInitialModel and default to Claude Opus 4.5 for Anthropic models/model instructionpaddingX setting (#936 by @Perlence)npm install after cloning git repositories with a package.jsonarguments.done events on OpenAI-compatible endpoints (#917 by @williballenthin)[paste #N ...] markers (#912)--session flag (#932 by @armanddp)setEditorComponent() (#947 by @Perlence)markdown.codeBlockIndent setting to customize code block indentation in rendered output (#855 by @terrorobe)inline-bash.ts example extension for expanding !{command} patterns in prompts (#881 by @scutifer)antigravity-image-gen.ts example extension for AI image generation via Google Antigravity (#893 by @ben-vargas)PI_SHARE_VIEWER_URL environment variable for custom share viewer URLs (#889 by @andresaraujo)l to Shift+L so users can search for entries containing "l" (#861 by @mitsuhiko)~/.pi/agent/ paths instead of respecting PI_CODING_AGENT_DIR (#887 by @aliou)write tool not displaying errors in the UI when execution fails (#856)/ characters (e.g., folder1/folder2) (#882 by @richardgill)(mailto:...) suffix (#888 by @terrorobe)@ file autocomplete adding space after directories, breaking continued autocomplete into subdirectorieswidgetPlacement in pi.addWidget() (#850 by @marckrenn)AWS_CONTAINER_CREDENTIALS_RELATIVE_URI, AWS_CONTAINER_CREDENTIALS_FULL_URI, AWS_WEB_IDENTITY_TOKEN_FILE (#848)/settings (#847 by @unexge)/model selector scope toggle so you can switch between all and scoped models when scoped models are saved (#844)strictResponsesPairing compat option from models.json schema (no longer needed)strictResponsesPairing compat option for custom OpenAI Responses models on Azure (#768 by @prateekmedia)/resume) now supports path display toggle (Ctrl+P) and session deletion (Ctrl+D) with inline confirmation (#816 by @w-winter)#) instead of query strings (?) to prevent session IDs from being sent to buildwithpi.ai (#829 by @terrorobe)models.json can now be retrieved via shell command using ! prefix (e.g., "apiKey": "!security find-generic-password -ws 'anthropic'" for macOS Keychain) (#762 by @cv)pi.setLabel(entryId, label) in ExtensionAPI for setting per-entry labels from extensions (#806)keyHint, appKeyHint, editorKey, appKey, rawKeyHint for extensions to format keybinding hints consistently (#802 by @dannote)VERSION from the package index and updated the custom-header example. (#798 by @tallshort)showHardwareCursor setting to control cursor visibility while still positioning it for IME support. (#800 by @ghoulr)ctx.compact() and ctx.getContextUsage() to extension contexts for programmatic compaction and context usage checks.stopReason: "error", its tool calls are now excluded from pending tool tracking, preventing synthetic tool results from being generated for calls that will be dropped by provider-specific converters. (#812)pi-internal:// path resolution from the read tool.quietStartup setting to silence startup output (version header, loaded context info, model scope line). Changelog notifications are still shown. (#777 by @ribelo)editorPaddingX setting for horizontal padding in input editor (0-3, default: 0)shellCommandPrefix setting to prepend commands to every bash execution, enabling alias expansion in non-interactive shells (e.g., "shellCommandPrefix": "shopt -s expand_aliases") (#790 by @richardgill)getArgumentCompletions in pi.registerCommand() (#775 by @ribelo)getShellConfig for extensions to detect user's shell environment (#766 by @dannote)thinkingText and selectedBg to theme schema (#763 by @scutifer)navigateTree() now supports replaceInstructions option to replace the default summarization prompt entirely, and label option to attach a label to the branch summary entry (#787 by @mitsuhiko)--session <UUID> to search globally across projects if not found locally, with option to fork sessions from other projects (#785 by @ribelo)--no-extensions flag not preventing extension discovery (#776)pi.sendMessage({ display: true }) is called during session_start (#765 by @dannote)PI_CODING_AGENT_DIR env var not expanding tilde (~) to home directory (#778 by @aliou)@, ?) not working in editor (#779 by @iamd3vil)PI_HARDWARE_CURSOR=1 to enable (replaces PI_NO_HARDWARE_CURSOR=1 which disabled it).Editor directly must now pass TUI as the first constructor argument: new Editor(tui, theme). The tui parameter is available in extension factory functions. (#732)gpt-5.1, gpt-5.2, gpt-5.1-codex-mini, gpt-5.2-codex). Features include static system prompt for OpenAI allowlisting, prompt caching via session ID, and reasoning signature retention across turns. Set OPENAI_API_KEY and use --provider openai-codex or select a Codex model. (#737)pi-internal:// URL scheme in read tool for accessing internal documentation. The model can read files from the coding-agent package (README, docs, examples) to learn about extending pi.input event in extension system for intercepting, transforming, or handling user input before the agent processes it. Supports three result types: continue (pass through), transform (modify text/images), handled (respond without LLM). Handlers chain transforms and short-circuit on handled. (#761 by @nicobailon)input-transform.ts demonstrating input interception patterns (quick mode, instant commands, source routing) (#761 by @nicobailon)renderCall/renderResult now render in /share and /export output with ANSI-to-HTML color conversion (#702 by @aliou)/skill:name) are now expanded in AgentSession instead of interactive mode. This enables skill commands in RPC and print modes, and allows the input event to intercept /skill:name before expansion.setEditorText. Content now scrolls vertically with indicators showing lines above/below the viewport. (#732)echo foo | pi is equivalent to pi -p foo. When stdin is piped, print mode is automatically enabled since interactive mode requires a TTY (#708)upstream connect, connection refused, and reset before headers patterns to auto-retry error detection (#733)yaml library. (#728 by @richardgill)ctx.shutdown() now waits for pending UI renders to complete before exiting, ensuring notifications and final output are visible (#756)--models or enabledModels) now remember the last selected model across sessions instead of always starting with the first model in the scope (#736 by @ogulcancelik)bun install instead of npm install in update notification when running under Bun (#714 by @dannote)/skill prompts now include the skill path (#711 by @jblwilliams)expandTools keybinding instead of hardcoded Ctrl+O (#717 by @dannote)APPEND_SYSTEM.md to append instructions to the system prompt (#716 by @tallshort)re: regex mode (#731 by @ogulcancelik)getAgentDir for extensions (#749 by @dannote)minimax-cn) provider support (#725 by @tallshort)gpt-5.2-codex models for GitHub Copilot and OpenCode Zen providers (#734 by @aadishv)wasm-vips with @silvia-odwyer/photon-node for image processing (#710 by @can1357)plan-mode/ shortcut changed from Shift+P to Ctrl+Alt+P to avoid conflict with typing capital P (#746 by @ferologics)pi for easier process identification (#742 by @richardgill)ctx.ui.custom() now accepts overlayOptions for overlay positioning and sizing (anchor, margins, offsets, percentages, absolute positioning) (#667 by @nicobailon)ctx.ui.custom() now accepts onHandle callback to receive the OverlayHandle for controlling overlay visibility (#667 by @nicobailon)overlay-qa-tests.ts with 10 commands for testing overlay positioning, animation, and toggle scenarios (#667 by @nicobailon)doom-overlay/ - DOOM game running as an overlay at 35 FPS (auto-downloads WAD on first run) (#667 by @nicobailon)sharp with wasm-vips for image processing (resize, PNG conversion). Eliminates native build requirements that caused installation failures on some systems. (#696)summarize.ts for summarizing conversations using custom UI and an external model (#684 by @scutifer)question.ts enhanced with custom UI for asking user questions (#693 by @ferologics)plan-mode/ enhanced with explicit step tracking and progress widget (#694 by @ferologics)questionnaire.ts for multi-question input with tab bar navigation (#695 by @ferologics)AI_GATEWAY_API_KEY and use --provider vercel-ai-gateway. Token usage is currently reported incorrectly by Anthropic Messages compatible endpoint. (#689 by @timolins)@mariozechner/jiti to v2.6.5 which bundles babel for Bun binary compatibility. (#681)strip_components=1 extraction. (#681)@mariozechner/jiti fork with virtualModules support. Bundled packages (@sinclair/typebox, @mariozechner/pi-tui, @mariozechner/pi-ai, @mariozechner/pi-coding-agent) are accessible to extensions without filesystem node_modules./share now outputs buildwithpi.ai session preview URLs instead of pi.devMINIMAX_API_KEY and use minimax/MiniMax-M2.1 (#656 by @dannote)/scoped-models: Alt+Up/Down to reorder enabled models. Order is preserved when saving with Ctrl+S and determines Ctrl+P cycling order. (#676 by @thomasmhr)sandbox/ for OS-level bash sandboxing using @anthropic-ai/sandbox-runtime with per-project config (#673 by @dannote)pi.getAllTools() now returns ToolInfo[] (with name and description) instead of string[]. Extensions that only need names can use .map(t => t.name). (#648 by @carsonfarmer)/name <name> command sets a display name shown in the session selector instead of the first message. Useful for distinguishing forked sessions. Extensions can use pi.setSessionName() and pi.getSessionName(). (#650 by @scutifer)notify.ts for desktop notifications via OSC 777 escape sequence (#658 by @ferologics)Alt+Up restore shortcut (#657 by @tmustier)/resume session selector to jump by 5 items (#662 by @aliou)/settings menu: type to filter settings by label (#643 by @ninlds)getSettingsListTheme() now work in dev mode with tsxctx.ui.editor()) now uses Enter to submit and Shift+Enter for newlines, matching the main editor. Previously used Ctrl+Enter to submit. Extensions with hardcoded "ctrl+enter" hints need updating. (#642 by @mitsuhiko)/branch command to /fork (#641)
branch → fork, get_branch_messages → get_fork_messagesbranch() → fork(), getBranchMessages() → getForkMessages()branch() → fork(), getUserMessagesForBranching() → getUserMessagesForForking()session_before_branch → session_before_fork, session_branch → session_forkdoubleEscapeAction: "branch" | "tree" → "fork" | "tree"SessionManager.list() and SessionManager.listAll() are now async, returning Promise<SessionInfo[]>. Callers must await them. (#620 by @tmustier)/resume selector now toggles between current-folder and all sessions with Tab, showing the session cwd in the All view and loading progress. (#620 by @tmustier)SessionManager.list() and SessionManager.listAll() accept optional onProgress callback for progress updatesSessionInfo.cwd field containing the session's working directory (empty string for old sessions)SessionListProgress type export for progress callbacks/scoped-models command to enable/disable models for Ctrl+P cycling. Changes are session-only by default; press Ctrl+S to persist to settings.json. (#626 by @CarlosGtrz)model_select extension hook fires when model changes via /model, model cycling, or session restore with source field and previousModel (#628 by @marckrenn)ctx.ui.setWorkingMessage() extension API to customize the "Working..." message during streaming (#625 by @nicobailon)/skill:name commands for quick access. Toggle via /settings or skills.enableSkillCommands in settings.json. (#630 by @Dwsy)/skbra to match /skill:brave-search)/tree branch summarization now offers three options: "No summary", "Summarize", and "Summarize with custom prompt". Custom prompts are appended as additional focus to the default summarization instructions. (#642 by @mitsuhiko)--resume (#633 by @aos)ctx.model is now a getter that returns the current model instead of a snapshot from when the context was created (#634 by @ogulcancelik)fs.watch on the file. Now watches the directory instead.:3F in MAC addresses) was incorrectly filtered out (#623 by @ogulcancelik)/model <search> now pre-filters the model selector or auto-selects on exact match. Use provider/model syntax to disambiguate (e.g., /model openai/gpt-4). (#587 by @zedrdave)FooterDataProvider for custom footers: ctx.ui.setFooter() now receives a third footerData parameter providing getGitBranch(), getExtensionStatuses(), and onBranchChange() for reactive updates (#600 by @nicobailon)Alt+Up hotkey to restore queued steering/follow-up messages back into the editor without aborting the current run (#604 by @tmustier)prompts/ folders are now followed when loading prompt templates (#601 by @aliou)OPENCODE_API_KEY env var and use opencode/<model-id> (e.g., opencode/claude-opus-4-5)./login to authenticate with your Claude Pro/Max subscription./login). Use API keys instead.docs/tui.mdsetTheme() now triggers a full rerender so previously rendered components update with the new theme colorsmac-system-theme.ts example now polls every 2 seconds and uses osascript for real-time macOS appearance detectionbefore_agent_start event now receives systemPrompt in the event object and returns systemPrompt (full replacement) instead of systemPromptAppend. Extensions that were appending must now use event.systemPrompt + extra pattern. (#575)discoverSkills() now returns { skills: Skill[], warnings: SkillWarning[] } instead of Skill[]. This allows callers to handle skill loading warnings. (#577 by @cv)ctx.ui.getAllThemes(), ctx.ui.getTheme(name), and ctx.ui.setTheme(name | Theme) methods for extensions to list, load, and switch themes at runtime (#576)--no-tools flag to disable all built-in tools, allowing extension-only tool setups (#557 by @cv)ReadOperations, WriteOperations, EditOperations, BashOperations, LsOperations, GrepOperations, FindOperationsuser_bash event for intercepting user !/!! commands, allowing extensions to redirect to remote systems (#528)setActiveTools() in ExtensionAPI for dynamic tool managementrenderCall/renderResultssh.ts example: remote tool execution via --ssh user@host:/pathinteractive-shell.ts example: run interactive commands (vim, git rebase, htop) with full terminal access via !i prefix or auto-detection/copy command using wl-copy with xclip/xsel fallback (#570 by @OgulcanCelik)ctx.ui.custom() now accepts { overlay: true } option for floating modal components that composite over existing content without clearing the screen (#558 by @nicobailon)AgentSession.skills and AgentSession.skillWarnings properties to access loaded skills without rediscovery (#577 by @cv)systemPrompt in createAgentSession() now works as a full replacement instead of having context files and skills appended, matching documented behavior (#543)--no-skills flag now correctly prevents skills from loading in interactive mode (#577 by @cv)ctx.ui.custom() factory signature changed from (tui, theme, done) to (tui, theme, keybindings, done) for keybinding access in custom componentsLoadedExtension type renamed to ExtensionLoadExtensionsResult.setUIContext() removed, replaced with runtime: ExtensionRuntimeExtensionRunner constructor now requires runtime: ExtensionRuntime as second parameterExtensionRunner.initialize() signature changed from options object to positional params (actions, contextActions, commandContextActions?, uiContext?)ExtensionRunner.getHasUI() renamed to hasUI()gpt-5, gpt-5-mini, gpt-5-nano, codex-mini-latest). Use canonical IDs: gpt-5.1, gpt-5.1-codex-mini, gpt-5.2, gpt-5.2-codex. (#536 by @ghoulr)--no-extensions flag to disable extension discovery while still allowing explicit -e paths (#524 by @cv)InteractiveMode, runPrintMode(), runRpcMode() exported for building custom run modes. See docs/sdk.md.PI_SKIP_VERSION_CHECK environment variable to disable new version notifications at startup (#549 by @aos)thinkingBudgets setting to customize token budgets per thinking level for token-based providers (#529 by @melihmucuk)ctx.ui.select(), ctx.ui.confirm(), ctx.ui.input()) now support a timeout option with live countdown display (#522 by @nicobailon)ctx.ui.setEditorComponent(). See examples/extensions/modal-editor.ts and docs/tui.md Pattern 7.ctx.shutdown() is now available in extension contexts for requesting a graceful shutdown. In interactive mode, shutdown is deferred until the agent becomes idle (after processing all queued steering and follow-up messages). In RPC mode, shutdown is deferred until after completing the current command response. In print mode, shutdown is a no-op as the process exits automatically when prompts complete. (#542 by @kaofelix)enabledModels is configured (#540 by @ferologics)settings.json while pi is running are now preserved when pi saves settings (#527 by @ferologics)context_length_exceeded errors.ctx.ui.select(), ctx.ui.confirm(), ctx.ui.input()) now accept an optional AbortSignal to programmatically dismiss dialogs. Useful for implementing timeouts. See examples/extensions/timed-confirm.ts. (#474)setModel(), getThinkingLevel(), setThinkingLevel() methods for extensions to change model and thinking level at runtime (#509)truncateHead, truncateTail, truncateLine, formatSize, DEFAULT_MAX_BYTES, DEFAULT_MAX_LINES, TruncationOptions, TruncationResulttruncated-tool.ts demonstrating proper output truncation with custom rendering for extensionspreset.ts demonstrating preset configurations with model/thinking/tools switching (#347)docs/extensions.mdArminComponent, AssistantMessageComponent, BashExecutionComponent, BorderedLoader, BranchSummaryMessageComponent, CompactionSummaryMessageComponent, CustomEditor, CustomMessageComponent, DynamicBorder, ExtensionEditorComponent, ExtensionInputComponent, ExtensionSelectorComponent, FooterComponent, LoginDialogComponent, ModelSelectorComponent, OAuthSelectorComponent, SessionSelectorComponent, SettingsSelectorComponent, ShowImagesSelectorComponent, ThemeSelectorComponent, ThinkingSelectorComponent, ToolExecutionComponent, TreeSelectorComponent, UserMessageComponent, UserMessageSelectorComponent, plus utilities renderDiff, truncateToVisualLinesdocs/tui.md: Common Patterns section with copy-paste code for SelectList, BorderedLoader, SettingsList, setStatus, setWidget, setFooterdocs/tui.md: Key Rules section documenting critical patterns for extension UI developmentdocs/extensions.md: Exhaustive example links for all ExtensionAPI methods and eventsdocs/tui.md for TUI component developmentpi -r) and --session flag now support searching/resuming by session ID (UUID prefix) (#495 by @arunsathiya)ctx.ui.setHeader(), see examples/extensions/custom-header.ts (#500 by @tudoroancea)/hotkeys: added !! shortcut for running bash without adding output to context/login to re-authenticate (#498)ctx.ui.setFooter(), see examples/extensions/custom-footer.ts (#481)blockImages setting to prevent images from being sent to LLM providers (#492 by @jsinge97)pi.sendUserMessage() (#483)minimatch as a direct dependency for explicit imports.wl-paste with xclip fallback (#488 by @ghoulr)settings.json now respect package.json manifests, matching global extension behavior (#480 by @prateekmedia)/share/share (iframe context)claude-rules to load .claude/rules/ entries into the system prompt (#461 by @vaayne)dumb, empty, or linux (fixes colors over SSH)fd, rg) now stored in ~/.pi/agent/bin/ instead of tools/, eliminating false deprecation warnings (#470 by @mcinteerj)settings.json were not loaded (#463 by @melihmucuk)fd.exe and rg.exe in tools/ on Windows (#458 by @carlosgtrz)examples/extensions/with-deps to workspaces to fix typecheck (#467 by @aliou)extensions: [] now disables extension discovery as documented (#465 by @aliou)/login openai-codex (#451 by @kim0)This release unifies hooks and custom tools into a single "extensions" system and renames "slash commands" to "prompt templates". (#454)
Before migrating, read:
Hooks and custom tools are now unified as extensions. Both were TypeScript modules exporting a factory function that receives an API object. Now there's one concept, one discovery location, one CLI flag, one settings.json entry.
Automatic migration:
commands/ directories are automatically renamed to prompts/ on startup (both ~/.pi/agent/commands/ and .pi/commands/)Manual migration required:
hooks/ and tools/ directories to extensions/ (deprecation warnings shown on startup)settings.json if you have explicit hook and custom tool paths configuredDirectory changes:
# Before
~/.pi/agent/hooks/*.ts → ~/.pi/agent/extensions/*.ts
~/.pi/agent/tools/*.ts → ~/.pi/agent/extensions/*.ts
.pi/hooks/*.ts → .pi/extensions/*.ts
.pi/tools/*.ts → .pi/extensions/*.ts
Extension discovery rules (in extensions/ directories):
extensions/*.ts or *.js → loaded directlyextensions/myext/index.ts → loaded as single extensionSubdirectory with package.json: extensions/myext/package.json with "pi" field → loads declared paths
// extensions/my-package/package.json
{
"name": "my-extension-package",
"dependencies": { "zod": "^3.0.0" },
"pi": {
"extensions": ["./src/main.ts", "./src/tools.ts"]
}
}
No recursion beyond one level. Complex packages must use the package.json manifest. Dependencies are resolved via jiti, and extensions can be published to and installed from npm.
Type renames:
HookAPI → ExtensionAPIHookContext → ExtensionContextHookCommandContext → ExtensionCommandContextHookUIContext → ExtensionUIContextCustomToolAPI → ExtensionAPI (merged)CustomToolContext → ExtensionContext (merged)CustomToolUIContext → ExtensionUIContextCustomTool → ToolDefinitionCustomToolFactory → ExtensionFactoryHookMessage → CustomMessageImport changes:
// Before (hook)
import type { HookAPI, HookContext } from "@mariozechner/pi-coding-agent";
export default function (pi: HookAPI) { ... }
// Before (custom tool)
import type { CustomToolFactory } from "@mariozechner/pi-coding-agent";
const factory: CustomToolFactory = (pi) => ({ name: "my_tool", ... });
export default factory;
// After (both are now extensions)
import type { ExtensionAPI } from "@mariozechner/pi-coding-agent";
export default function (pi: ExtensionAPI) {
pi.on("tool_call", async (event, ctx) => { ... });
pi.registerTool({ name: "my_tool", ... });
}
Custom tools now have full context access. Tools registered via pi.registerTool() now receive the same ctx object that event handlers receive. Previously, custom tools had limited context. Now all extension code shares the same capabilities:
pi.registerTool() - Register tools the LLM can callpi.registerCommand() - Register commands like /mycommandpi.registerShortcut() - Register keyboard shortcuts (shown in /hotkeys)pi.registerFlag() - Register CLI flags (shown in --help)pi.registerMessageRenderer() - Custom TUI rendering for message typespi.on() - Subscribe to lifecycle events (tool_call, session_start, etc.)pi.sendMessage() - Inject messages into the conversationpi.appendEntry() - Persist custom data in session (survives restart/branch)pi.exec() - Run shell commandspi.getActiveTools() / pi.setActiveTools() - Dynamic tool enable/disablepi.getAllTools() - List all available toolspi.events - Event bus for cross-extension communicationctx.ui.confirm() / select() / input() - User promptsctx.ui.notify() - Toast notificationsctx.ui.setStatus() - Persistent status in footer (multiple extensions can set their own)ctx.ui.setWidget() - Widget display above editorctx.ui.setTitle() - Set terminal window titlectx.ui.custom() - Full TUI component with keyboard handlingctx.ui.editor() - Multi-line text editor with external editor supportctx.sessionManager - Read session entries, get branch historySettings changes:
// Before
{
"hooks": ["./my-hook.ts"],
"customTools": ["./my-tool.ts"]
}
// After
{
"extensions": ["./my-extension.ts"]
}
CLI changes:
# Before
pi --hook ./safety.ts --tool ./todo.ts
# After
pi --extension ./safety.ts -e ./todo.ts
"Slash commands" (markdown files defining reusable prompts invoked via /name) are renamed to "prompt templates" to avoid confusion with extension-registered commands.
Automatic migration: The commands/ directory is automatically renamed to prompts/ on startup (if prompts/ doesn't exist). Works for both regular directories and symlinks.
Directory changes:
~/.pi/agent/commands/*.md → ~/.pi/agent/prompts/*.md
.pi/commands/*.md → .pi/prompts/*.md
SDK type renames:
FileSlashCommand → PromptTemplateLoadSlashCommandsOptions → LoadPromptTemplatesOptionsSDK function renames:
discoverSlashCommands() → discoverPromptTemplates()loadSlashCommands() → loadPromptTemplates()expandSlashCommand() → expandPromptTemplate()getCommandsDir() → getPromptsDir()SDK option renames:
CreateAgentSessionOptions.slashCommands → .promptTemplatesAgentSession.fileCommands → .promptTemplatesPromptOptions.expandSlashCommands → .expandPromptTemplatesDiscovery functions:
discoverAndLoadHooks() → discoverAndLoadExtensions()discoverAndLoadCustomTools() → merged into discoverAndLoadExtensions()loadHooks() → loadExtensions()loadCustomTools() → merged into loadExtensions()Runner and wrapper:
HookRunner → ExtensionRunnerwrapToolsWithHooks() → wrapToolsWithExtensions()wrapToolWithHooks() → wrapToolWithExtensions()CreateAgentSessionOptions:
.hooks → removed (use .additionalExtensionPaths for paths).additionalHookPaths → .additionalExtensionPaths.preloadedHooks → .preloadedExtensions.customTools type changed: Array<{ path?; tool: CustomTool }> → ToolDefinition[].additionalCustomToolPaths → merged into .additionalExtensionPaths.slashCommands → .promptTemplatesAgentSession:
.hookRunner → .extensionRunner.fileCommands → .promptTemplates.sendHookMessage() → .sendCustomMessage()Automatic. Session version bumped from 2 to 3. Existing sessions are migrated on first load:
"hookMessage" → "custom"hooks and customTools arrays replaced with single extensions array--hook and --tool flags replaced with --extension / -ehooks/, tools/ → extensions/; commands/ → prompts/package.json with dependencies (resolved via jiti)docs/hooks.md and docs/custom-tools.md merged into docs/extensions.mdexamples/hooks/ and examples/custom-tools/ merged into examples/extensions/customTools option now accepts ToolDefinition[] directly (simplified from Array<{ path?, tool }>)extensions option accepts ExtensionFactory[] for inline extensionsadditionalExtensionPaths replaces both additionalHookPaths and additionalCustomToolPathspi.getActiveTools() and pi.setActiveTools(toolNames) for dynamically enabling/disabling tools from hookspi.getAllTools() to enumerate all configured tools (built-in via --tools or default, plus custom tools)pi.registerFlag(name, options) and pi.getFlag(name) for hooks to register custom CLI flags (parsed automatically)pi.registerShortcut(shortcut, options) for hooks to register custom keyboard shortcuts using KeyId (e.g., Key.shift("p")). Conflicts with built-in shortcuts are skipped, conflicts between hooks logged as warnings.ctx.ui.setWidget(key, content) for status displays above the editor. Accepts either a string array or a component factory function.theme.strikethrough(text) for strikethrough text stylingbefore_agent_start handlers can now return systemPromptAppend to dynamically append text to the system prompt for that turn. Multiple hooks' appends are concatenated.before_agent_start handlers can now return multiple messages (all are injected, not just the first)/hotkeys command now shows hook-registered shortcuts in a separate "Hooks" sectionplan-mode.ts - Claude Code-style read-only exploration mode:
/plan command, Shift+P shortcut, or --plan CLI flagread, bash, grep, find, ls (no edit/write)rm, mv, git commit, npm install, etc.)[DONE:id]agent_end hook (parses completed items from final message)/todos command to view current plan progress⏸ plan indicator in footer when in plan mode, 📋 2/5 when executingtools.ts - Interactive /tools command to enable/disable tools with session persistencepirate.ts - Demonstrates systemPromptAppend to make the agent speak like a pirate--tools limits the initially active set. Hooks can enable any tool from the registry via pi.setActiveTools().setActiveTools(), updating tool descriptions and guidelines to match the new tool setpi.events) for tool/hook communication: shared pub/sub between custom tools and hookspi.sendMessage() to send messages directly to the agent session without needing the event bussendMessage() supports deliverAs: "nextTurn" to queue messages for the next user prompt[paste #N ...] placeholders (#444 by @aliou)@mariozechner/pi-tui: All isXxx() key detection functions (isEnter(), isEscape(), isCtrlC(), etc.) have been removed. Use matchesKey(data, keyId) instead (e.g., matchesKey(data, "enter"), matchesKey(data, "ctrl+c")). This affects hooks and custom tools that use ctx.ui.custom() with keyboard input handling. (#405)Ctrl+V. Images are saved to a temp file and attached to the message. Works on macOS, Windows, and Linux (X11). (#419)~/.pi/agent/keybindings.json. All keyboard shortcuts (editor navigation, deletion, app actions like model cycling, etc.) can now be customized. Supports multiple bindings per action. (#405 by @hjanuschka)/quit and /exit slash commands to gracefully exit the application. Unlike double Ctrl+C, these properly await hook and custom tool cleanup handlers before exiting. (#426 by @ben-vargas)subagent.ts instead of index.ts (#427 by @Whamp)--list-models no longer shows Google Vertex AI models without explicit authentication configured$ARGUMENTS syntax for custom slash commands as alternative to $@ for all arguments joined. Aligns with patterns used by Claude, Codex, and OpenCode. Both syntaxes remain fully supported. (#418 by @skuridin)pi.sendMessage())steer() and followUp() now expand file-based slash commands and error on hook commands (hook commands cannot be queued)prompt() accepts new streamingBehavior option ("steer" or "followUp") to specify queueing behavior during streamingprompt command now accepts optional streamingBehavior field
(#420)$1, $2, etc.) before all-arguments ($@, $ARGUMENTS) to prevent recursive substitution when argument values contain dollar-digit patterns like $100. (#418 by @skuridin)!!command to execute a bash command that is shown in the TUI and saved to session history but excluded from LLM context. Useful for running commands you don't want the AI to see. (#414)queueMessage() method has been split into two methods with different delivery semantics (#403):
steer(text): Interrupts the agent mid-run (Enter while streaming). Delivered after current tool execution.followUp(text): Waits until the agent finishes (Alt+Enter while streaming). Delivered only when agent stops.queueMode setting renamed to steeringMode. Added new followUpMode setting. Old settings.json files are migrated automatically.queueMessage() → steer() and followUp()queueMode getter → steeringMode and followUpMode getterssetQueueMode() → setSteeringMode() and setFollowUpMode()queuedMessageCount → pendingMessageCountgetQueuedMessages() → getSteeringMessages() and getFollowUpMessages()clearQueue() now returns { steering: string[], followUp: string[] }hasQueuedMessages() → hasPendingMessages()pi.sendMessage() second parameter changed from triggerTurn?: boolean to options?: { triggerTurn?, deliverAs? }. Use deliverAs: "followUp" for follow-up delivery. Affects both hooks and internal sendHookMessage() method.queue_message command → steer and follow_up commandsset_queue_mode command → set_steering_mode and set_follow_up_mode commandsRpcSessionState.queueMode → steeringMode and followUpMode/tree (default) or /branch. Configure via /settings or doubleEscapeAction in settings.json (#404)google-vertex): access Gemini models via Google Cloud Vertex AI using Application Default Credentials (#300 by @default-anton)models.json: override just baseUrl to route a built-in provider through a proxy while keeping all its models, or define models to fully replace the provider (#406 by @yevhen)/settings or images.autoResize in settings.json. (#402 by @mitsuhiko)Theme and ThemeColor types now exported for hooks using ctx.ui.custom()/model selector now opens instantly instead of waiting for OAuth token refresh. Token refresh is deferred until a model is actually used.AgentSession.prompt() now throws if called while the agent is already streaming, preventing race conditions. Use steer() or followUp() to queue messages during streaming.isBashToolResult, etc.) now exported at runtime, not just in type declarations (#397)This release introduces session trees for in-place branching, major API changes to hooks and custom tools, and structured compaction with file tracking.
Sessions now use a tree structure with id/parentId fields. This enables in-place branching: navigate to any previous point with /tree, continue from there, and switch between branches while preserving all history in a single file.
Existing sessions are automatically migrated (v1 → v2) on first load. No manual action required.
New entry types: BranchSummaryEntry (context from abandoned branches), CustomEntry (hook state), CustomMessageEntry (hook-injected messages), LabelEntry (bookmarks).
See docs/session.md for the file format and SessionManager API.
The hooks API has been restructured with more granular events and better session access.
Type renames:
HookEventContext → HookContextHookCommandContext is now a new interface extending HookContext with session control methodsEvent changes:
session event is now split into granular events: session_start, session_before_switch, session_switch, session_before_branch, session_branch, session_before_compact, session_compact, session_shutdownsession_before_switch and session_switch events now include reason: "new" | "resume" to distinguish between /new and /resumesession_before_tree and session_tree events for /tree navigation (hook can provide custom branch summary)before_agent_start event: inject messages before the agent loop startscontext event: modify messages non-destructively before each LLM callctx.sessionManager.getEntries() or ctx.sessionManager.getBranch() insteadAPI changes:
pi.send(text, attachments?) → pi.sendMessage(message, triggerTurn?) (creates CustomMessageEntry)pi.appendEntry(customType, data?) for hook state persistence (not in LLM context)pi.registerCommand(name, options) for custom slash commands (handler receives HookCommandContext)pi.registerMessageRenderer(customType, renderer) for custom TUI renderingctx.isIdle(), ctx.abort(), ctx.hasQueuedMessages() for agent state (available in all events)ctx.ui.editor(title, prefill?) for multi-line text editing with Ctrl+G external editor supportctx.ui.custom(component) for full TUI component rendering with keyboard focusctx.ui.setStatus(key, text) for persistent status text in footer (multiple hooks can set their own)ctx.ui.theme getter for styling text with theme colorsctx.exec() moved to pi.exec()ctx.sessionFile → ctx.sessionManager.getSessionFile()ctx.modelRegistry and ctx.model for API key resolutionHookCommandContext (slash commands only):
ctx.waitForIdle() - wait for agent to finish streamingctx.newSession(options?) - create new sessions with optional setup callbackctx.navigateTree(targetId, options?) - navigate the session treeThese methods are only on HookCommandContext (not HookContext) because they can deadlock if called from event handlers that run inside the agent loop.
Removed:
hookTimeout setting (hooks no longer have timeouts; use Ctrl+C to abort)resolveApiKey parameter (use ctx.modelRegistry.getApiKey(model))See docs/hooks.md and examples/hooks/ for the current API.
The custom tools API has been restructured to mirror the hooks pattern with a context object.
Type renames:
CustomAgentTool → CustomToolToolAPI → CustomToolAPIToolContext → CustomToolContextToolSessionEvent → CustomToolSessionEventExecute signature changed:
// Before (v0.30.2)
execute(toolCallId, params, signal, onUpdate)
// After
execute(toolCallId, params, onUpdate, ctx, signal?)
The new ctx: CustomToolContext provides sessionManager, modelRegistry, model, and agent state methods:
ctx.isIdle() - check if agent is streamingctx.hasQueuedMessages() - check if user has queued messages (skip interactive prompts)ctx.abort() - abort current operation (fire-and-forget)Session event changes:
CustomToolSessionEvent now only has reason and previousSessionFilectx.sessionManager.getBranch() or ctx.sessionManager.getEntries() to reconstruct state"start" | "switch" | "branch" | "tree" | "shutdown" (no separate "new" reason; /new triggers "switch")dispose() method removed. Use onSession with reason: "shutdown" for cleanupSee docs/custom-tools.md and examples/custom-tools/ for the current API.
Type changes:
CustomAgentTool → CustomToolAppMessage → AgentMessagesessionFile returns string | undefined (was string | null)model returns Model | undefined (was Model | null)Attachment type removed. Use ImageContent from @mariozechner/pi-ai instead. Add images directly to message content arrays.AgentSession API:
branch(entryIndex: number) → branch(entryId: string)getUserMessagesForBranching() returns { entryId, text } instead of { entryIndex, text }reset() → newSession(options?) where options has optional parentSession for lineage trackingnewSession() and switchSession() now return Promise<boolean> (false if cancelled by hook)navigateTree(targetId, options?) for in-place tree navigationHook integration:
sendHookMessage(message, triggerTurn?) for hook message injectionSessionManager API:
saveXXX() → appendXXX() (e.g., appendMessage, appendCompaction)branchInPlace() → branch()reset() → newSession(options?) with optional parentSession for lineage trackingcreateBranchedSessionFromEntries(entries, index) → createBranchedSession(leafId)SessionHeader.branchedFrom → SessionHeader.parentSessionsaveCompaction(entry) → appendCompaction(summary, firstKeptEntryId, tokensBefore, details?)getEntries() now excludes the session header (use getHeader() separately)getSessionFile() returns string | undefined (undefined for in-memory sessions)getTree(), getBranch(), getLeafId(), getLeafEntry(), getEntry(), getChildren(), getLabel()appendCustomEntry(), appendCustomMessageEntry(), appendLabelChange()branch(entryId), branchWithSummary()ModelRegistry (new):
ModelRegistry is a new class that manages model discovery and API key resolution. It combines built-in models with custom models from models.json and resolves API keys via AuthStorage.
import {
discoverAuthStorage,
discoverModels,
} from "@mariozechner/pi-coding-agent";
const authStorage = discoverAuthStorage(); // ~/.pi/agent/auth.json
const modelRegistry = discoverModels(authStorage); // + ~/.pi/agent/models.json
// Get all models (built-in + custom)
const allModels = modelRegistry.getAll();
// Get only models with valid API keys
const available = await modelRegistry.getAvailable();
// Find specific model
const model = modelRegistry.find("anthropic", "claude-sonnet-4-20250514");
// Get API key for a model
const apiKey = await modelRegistry.getApiKey(model);
This replaces the old resolveApiKey callback pattern. Hooks and custom tools access it via ctx.modelRegistry.
Renamed exports:
messageTransformer → convertToLlmSessionContext alias LoadedSession removedSee docs/sdk.md and examples/sdk/ for the current API.
Session commands:
reset command → new_session command with optional parentSession fieldBranching commands:
branch command: entryIndex → entryIdget_branch_messages response: entryIndex → entryIdType changes:
AgentMessage (was AppMessage)prompt command: attachments field replaced with images field using ImageContent formatCompaction events:
auto_compaction_start now includes reason field ("threshold" or "overflow")auto_compaction_end now includes willRetry fieldcompact response includes full CompactionResult (summary, firstKeptEntryId, tokensBefore, details)See docs/rpc.md for the current protocol.
Compaction and branch summarization now use a structured output format:
readFiles and modifiedFiles arrays in details, accumulated across compactionsThe before_compact and before_tree hook events allow custom compaction implementations. See docs/compaction.md.
/tree command:
l to label entries as bookmarksEntry labels:
/tree → select → lLabelEntryTheme changes (breaking for custom themes):
Custom themes must add these new color tokens or they will fail to load:
selectedBg: background for selected/highlighted items in tree selector and other componentscustomMessageBg: background for hook-injected messages (CustomMessageEntry)customMessageText: text color for hook messagescustomMessageLabel: label color for hook messages (the [customType] prefix)Total color count increased from 46 to 50. See docs/themes.md for the full color list and copy values from the built-in dark/light themes.
Settings:
enabledModels: allowlist models in settings.json (same format as --models CLI)ctx.ui.setStatus(key, text) for hooks to display persistent status text in the footer (#385 by @prateekmedia)ctx.ui.theme getter for styling status text and other output with theme colors/share command to upload session as a secret GitHub gist and get a shareable URL via pi.dev (#380)export section in theme JSON (#387 by @mitsuhiko)ui.custom(), registerCommand(), and session persistence. See examples/hooks/snake.ts.thinkingText theme token: Configurable color for thinking block text. (#366 by @paulbettner)ANTHROPIC_OAUTH_TOKEN now takes precedence over ANTHROPIC_API_KEY<style> that could break DOM rendering--resume/--continue to default to off. (#342 by @aliou)tool_result event ignores errors from custom tools: The tool_result hook event was never emitted when tools threw errors, and always had isError: false for successful executions. Now emits the event with correct isError value in both success and error cases. (#374 by @nicobailon)/bin/sh instead of /bin/bash on Unix systems. (#328 by @dnouri)apiKey or model are missing. (#346 by @ronyrus)findMostRecentSession() now validates session headers before returning, preventing non-session JSONL files from being loadedgenerateSummary() and generateTurnPrefixSummary() now throw on LLM errors instead of returning empty stringssessionManager.getPath() to work only on the current branch path, eliminating 80+ lines of duplicate entry collection logic between prepareCompaction() and compact()--models and enabledModels now support glob patterns like github-copilot/* or *sonnet*. Previously, patterns were only matched literally or via substring search. (#337)AuthStorage.migrateLegacy() to new migrations.ts module.~/.pi/agent/ instead of ~/.pi/agent/sessions/<encoded-cwd>/, breaking --resume and /resume. Misplaced sessions are automatically migrated on startup. (#320 by @aliou)create(), continueRecent(), and list() changed from agentDir to sessionDir. When provided, it specifies the session directory directly (no cwd encoding). When omitted, uses default (~/.pi/agent/sessions/<encoded-cwd>/). open() no longer takes agentDir. (#313)--session-dir flag: Use a custom directory for sessions instead of the default ~/.pi/agent/sessions/<encoded-cwd>/. Works with -c (continue) and -r (resume) flags. (#313 by @scutifer)SYSTEM.md files to replace the default system prompt. Project-local .pi/SYSTEM.md takes precedence over global ~/.pi/agent/SYSTEM.md. CLI --system-prompt flag overrides both. (#309)/settings command: New settings menu consolidating thinking level, theme, queue mode, auto-compact, show images, hide thinking, and collapse changelog. Replaces individual /thinking, /queue, /theme, /autocompact, and /show-images commands. (#310)@sinclair/typebox to point to package root instead of entry file, allowing imports like @sinclair/typebox/compiler to resolve correctly. (#311 by @kim0)/clear to /new: The command to start a fresh session is now /new. Hook event reasons before_clear/clear are now before_new/new. Merry Christmas @mitsuhiko! (#305)/, ~, or .) after a word character, a space is automatically prepended. (#307 by @mitsuhiko)Credential storage refactored: API keys and OAuth tokens are now stored in ~/.pi/agent/auth.json instead of oauth.json and settings.json. Existing credentials are automatically migrated on first run. (#296)
SDK API changes (#296):
AuthStorage class for credential management (API keys and OAuth tokens)ModelRegistry class for model discovery and API key resolutiondiscoverAuthStorage() and discoverModels() discovery functionscreateAgentSession() now accepts authStorage and modelRegistry optionsconfigureOAuthStorage(), defaultGetApiKey(), findModel(), discoverAvailableModels()getApiKey callback option (use AuthStorage.setRuntimeApiKey() for runtime overrides)getModel() from @mariozechner/pi-ai for built-in models, modelRegistry.find() for custom models + built-in modelsSettings changes: Removed apiKeys from settings.json. Use auth.json instead. (#296)
--list-models output. (#295)</thinking> tags in responses. Unsigned thinking blocks (from aborted streams) are now converted to plain text without <thinking> tags. The TUI still displays them as thinking blocks. (#302 by @nicobailon)Compaction hook improvements: The before_compact session event now includes:
previousSummary: Summary from the last compaction (if any), so hooks can preserve accumulated contextmessagesToKeep: Messages that will be kept after the summary (recent turns), in addition to messagesToSummarizeresolveApiKey: Function to resolve API keys for any model (checks settings, OAuth, env vars)apiKey string in favor of resolveApiKey for more flexibilitySessionManager API cleanup:
loadSessionFromEntries() to buildSessionContext() (builds LLM context from entries, handling compaction)loadEntries() to getEntries() (returns defensive copy of all session entries)buildSessionContext() method to SessionManagerGHOSTTY_RESOURCES_DIR env var. (#299 by @nicobailon)~/.pi/agent/skills/my-skills -> /path/to/skills) are now correctly discovered and loaded.~/.pi/agent/settings.json under the apiKeys field (e.g., { "apiKeys": { "anthropic": "sk-..." } }). Settings keys take priority over environment variables. (#295)/login to authenticate. (#288)--system-prompt file path support: The --system-prompt argument now correctly resolves file paths (like --append-system-prompt already did). (#287 by @scutifer){ skipConversationRestore: true } from before_branch to create the branched session file without restoring conversation messages. Useful for checkpoint hooks that restore files separately. (#286 by @nicobarray)node_modules directories when recursively scanning for skills. Fixes ~60ms startup delay when skill directories contain npm dependencies.PI_TIMING=1 to see startup performance breakdown (interactive mode only).branch event into session event. BranchEvent, BranchEventResult types and pi.on("branch", ...) removed. Use pi.on("session", ...) with reason: "before_branch" | "branch" instead. AgentSession.branch() returns { cancelled } instead of { skipped }. AgentSession.reset() and switchSession() now return boolean (false if cancelled by hook). RPC commands reset, switch_session, and branch now include cancelled in response data. (#278)before_* variants (before_switch, before_clear, before_branch) that fire before actions and can be cancelled with { cancel: true }. Added shutdown reason for graceful exit handling. (#278)File tab completion display: File paths no longer get cut off early. Folders now show trailing / and removed redundant "directory"/"file" labels to maximize horizontal space. (#280)
Bash tool visual line truncation: Fixed bash tool output in collapsed mode to use visual line counting (accounting for line wrapping) instead of logical line counting. Now consistent with bash-execution.ts behavior. Extracted shared truncateToVisualLines utility. (#275)
cwd option from createAgentSession(). Added tool factory functions (createBashTool, createReadTool, etc.) for SDK users who specify custom cwd with explicit tools. (#279)SDK for programmatic usage: New createAgentSession() factory with full control over model, tools, hooks, skills, session persistence, and settings. Philosophy: "omit to discover, provide to override". Includes 12 examples and comprehensive documentation. (#272)
Project-specific settings: Settings now load from both ~/.pi/agent/settings.json (global) and <cwd>/.pi/settings.json (project). Project settings override global with deep merge for nested objects. Project settings are read-only (for version control). (#276)
SettingsManager static factories: SettingsManager.create(cwd?, agentDir?) for file-based settings, SettingsManager.inMemory(settings?) for testing. Added applyOverrides() for programmatic overrides.
SessionManager static factories: SessionManager.create(), SessionManager.open(), SessionManager.continueRecent(), SessionManager.inMemory(), SessionManager.list() for flexible session management.
Gemini 3 preview models: Added gemini-3-pro-preview and gemini-3-flash-preview to the google-gemini-cli provider. (#264 by @LukeFost)
External editor support: Press Ctrl+G to edit your message in an external editor. Uses $VISUAL or $EDITOR environment variable. On successful save, the message is replaced; on cancel, the original is kept. (#266 by @aliou)
Process suspension: Press Ctrl+Z to suspend pi and return to the shell. Resume with fg as usual. (#267 by @aliou)
Configurable skills directories: Added granular control over skill sources with enableCodexUser, enableClaudeUser, enableClaudeProject, enablePiUser, enablePiProject toggles, plus customDirectories and ignoredSkills settings. (#269 by @nicobailon)
Skills CLI filtering: Added --skills <patterns> flag for filtering skills with glob patterns. Also added includeSkills setting and glob pattern support for ignoredSkills. (#268)
Gemini image reading broken: Fixed the read tool returning images causing flaky/broken responses with Gemini models. Images in tool results are now properly formatted per the Gemini API spec.
Tab completion for absolute paths: Fixed tab completion producing //tmp instead of /tmp/. Also fixed symlinks to directories (like /tmp) not getting a trailing slash, which prevented continuing to tab through subdirectories.
Interruptible tool execution: Queuing a message while tools are executing now interrupts the current tool batch. Remaining tools are skipped with an error result, and your queued message is processed immediately. Useful for redirecting the agent mid-task. (#259 by @steipete)
Google Gemini CLI OAuth provider: Access Gemini 2.0/2.5 models for free via Google Cloud Code Assist. Login with /login and select "Google Gemini CLI". Uses your Google account with rate limits.
Google Antigravity OAuth provider: Access Gemini 3, Claude (sonnet/opus thinking models), and GPT-OSS models for free via Google's Antigravity sandbox. Login with /login and select "Antigravity". Uses your Google account with rate limits.
/model command now only shows models specified via --models flag when that flag is used, instead of showing all available models. This prevents accidentally selecting models from unintended providers. (#255)Connection errors not retried: Added "connection error" to the list of retryable errors so Anthropic connection drops trigger auto-retry instead of silently failing. (#252)
Thinking level not clamped on model switch: Fixed TUI showing xhigh thinking level after switching to a model that doesn't support it. Thinking level is now automatically clamped to model capabilities. (#253)
Cross-model thinking handoff: Fixed error when switching between models with different thinking signature formats (e.g., GPT-OSS to Claude thinking models via Antigravity). Thinking blocks without signatures are now converted to text with <thinking> delimiters.
OAuth and model config exports: Scripts using AgentSession directly can now import getAvailableModels, getApiKeyForModel, findModel, login, logout, and getOAuthProviders from @mariozechner/pi-coding-agent to reuse OAuth token storage and model resolution. (#245)
xhigh thinking level for gpt-5.2 models: The thinking level selector and shift+tab cycling now show xhigh option for gpt-5.2 and gpt-5.2-codex models (in addition to gpt-5.1-codex-max). (#236 by @theBucky)
Hooks wrap custom tools: Custom tools are now executed through the hook wrapper, so tool_call/tool_result hooks can observe, block, and modify custom tool executions (consistent with hook type docs). (#248 by @nicobailon)
Hook onUpdate callback forwarding: The onUpdate callback is now correctly forwarded through the hook wrapper, fixing custom tool progress updates. (#238 by @nicobailon)
Terminal cleanup on Ctrl+C in session selector: Fixed terminal not being properly restored when pressing Ctrl+C in the session selector. (#247 by @aliou)
OpenRouter models with colons in IDs: Fixed parsing of OpenRouter model IDs that contain colons (e.g., openrouter:meta-llama/llama-4-scout:free). (#242 by @aliou)
Global AGENTS.md loaded twice: Fixed global AGENTS.md being loaded twice when present in both ~/.pi/agent/ and the current directory. (#239 by @aliou)
Kitty keyboard protocol on Linux: Fixed keyboard input not working in Ghostty on Linux when Num Lock is enabled. The Kitty protocol includes Caps Lock and Num Lock state in modifier values, which broke key detection. Now correctly masks out lock key bits when matching keyboard shortcuts. (#243)
Emoji deletion and cursor movement: Backspace, Delete, and arrow keys now correctly handle multi-codepoint characters like emojis. Previously, deleting an emoji would leave partial bytes, corrupting the editor state. (#240)
Subagent orchestration example: Added comprehensive custom tool example for spawning and orchestrating sub-agents with isolated context windows. Includes scout/planner/reviewer/worker agents and workflow commands for multi-agent pipelines. (#215 by @nicobailon)
getMarkdownTheme() export: Custom tools can now import getMarkdownTheme() from @mariozechner/pi-coding-agent to use the same markdown styling as the main UI.
pi.exec() signal and timeout support: Custom tools and hooks can now pass { signal, timeout } options to pi.exec() for cancellation and timeout handling. The result includes a killed flag when the process was terminated.
Kitty keyboard protocol support: Shift+Enter, Alt+Enter, Shift+Tab, Ctrl+D, and all Ctrl+key combinations now work in Ghostty, Kitty, WezTerm, and other modern terminals. (#225 by @kim0)
Dynamic API key refresh: OAuth tokens (GitHub Copilot, Anthropic OAuth) are now refreshed before each LLM call, preventing failures in long-running agent loops where tokens expire mid-session. (#223 by @kim0)
/hotkeys command: Shows all keyboard shortcuts in a formatted table.
Markdown table borders: Tables now render with proper top and bottom borders.
Subagent example improvements: Parallel mode now streams updates from all tasks. Chain mode shows all completed steps during streaming. Expanded view uses proper markdown rendering with syntax highlighting. Usage footer shows turn count.
Skills standard compliance: Skills now adhere to the Agent Skills standard. Validates name (must match parent directory, lowercase, max 64 chars), description (required, max 1024 chars), and frontmatter fields. Warns on violations but remains lenient. Prompt format changed to XML structure. Removed {baseDir} placeholder in favor of relative paths. (#231)
JSON mode stdout flush: Fixed race condition where pi --mode json could exit before all output was written to stdout, causing consumers to miss final events.
Symlinked tools, hooks, and slash commands: Discovery now correctly follows symlinks when scanning for custom tools, hooks, and slash commands. (#219, #232 by @aliou)
Custom tools now require index.ts entry point: Auto-discovered custom tools must be in a subdirectory with an index.ts file. The old pattern ~/.pi/agent/tools/mytool.ts must become ~/.pi/agent/tools/mytool/index.ts. This allows multi-file tools to import helper modules. Explicit paths via --tool or settings.json still work with any .ts file.
Hook tool_result event restructured: The ToolResultEvent now exposes full tool result data instead of just text. (#233)
result: string fieldcontent: (TextContent | ImageContent)[] - full content arraydetails: unknown - tool-specific details (typed per tool via discriminated union on toolName)ToolResultEventResult.result renamed to ToolResultEventResult.text (removed), use content instead{ result: "..." } must change to { content: [{ type: "text", text: "..." }] }BashToolDetails, ReadToolDetails, GrepToolDetails, FindToolDetails, LsToolDetails, TruncationResultisBashToolResult, isReadToolResult, isEditToolResult, isWriteToolResult, isGrepToolResult, isFindToolResult, isLsToolResultSyntax highlighting: Added syntax highlighting for markdown code blocks, read tool output, and write tool content. Uses cli-highlight with theme-aware color mapping and VS Code-style syntax colors. (#214 by @svkozak)
Intra-line diff highlighting: Edit tool now shows word-level changes with inverse highlighting when a single line is modified. Multi-line changes show all removed lines first, then all added lines.
Gemini tool result format: Fixed tool result format for Gemini 3 Flash Preview which strictly requires { output: value } for success and { error: value } for errors. Previous format using { result, isError } was rejected by newer Gemini models. (#213, #220)
Google baseUrl configuration: Google provider now respects baseUrl configuration for custom endpoints or API proxies. (#216, #221 by @theBucky)
Google provider FinishReason: Added handling for new IMAGE_RECITATION and IMAGE_OTHER finish reasons. Upgraded @google/genai to 1.34.0.
Improved system prompt documentation section with clearer pointers to specific doc files for custom models, themes, skills, hooks, custom tools, and RPC.
Cleaned up documentation:
theme.md: Added missing color tokens (thinkingXhigh, bashMode)skills.md: Rewrote with better framing and exampleshooks.md: Fixed timeout/error handling docs, added import aliases sectioncustom-tools.md: Added intro with use cases and comparison tablerpc.md: Added missing hook_error event documentationREADME.md: Complete settings table, condensed philosophy section, standardized OAuth docsHooks loader now supports same import aliases as custom tools (@sinclair/typebox, @mariozechner/pi-ai, @mariozechner/pi-tui, @mariozechner/pi-coding-agent).
turn_end event's toolResults type changed from AppMessage[] to ToolResultMessage[]. If you have hooks that handle turn_end events and explicitly type the results, update your type annotations.Fixed Claude models via GitHub Copilot re-answering all previous prompts in multi-turn conversations. The issue was that assistant message content was sent as an array instead of a string, which Copilot's Claude adapter misinterpreted. Also added missing Openai-Intent: conversation-edits header and fixed X-Initiator logic to check for any assistant/tool message in history. (#209)
Detect image MIME type via file magic (read tool and @file attachments), not filename extension.
Fixed markdown tables overflowing terminal width. Tables now wrap cell contents to fit available width instead of breaking borders mid-row. (#206 by @kim0)
Fixed TUI performance regression caused by Box component lacking render caching. Built-in tools now use Text directly (like v0.22.5), and Box has proper caching for custom tool rendering.
Fixed custom tools failing to load from ~/.pi/agent/tools/ when pi is installed globally. Module imports (@sinclair/typebox, @mariozechner/pi-tui, @mariozechner/pi-ai) are now resolved via aliases.
Custom tools: Extend pi with custom tools written in TypeScript. Tools can provide custom TUI rendering, interact with users via pi.ui (select, confirm, input, notify), and maintain state across sessions via onSession callback. See docs/custom-tools.md and examples/custom-tools/. (#190)
Hook and tool examples: Added examples/hooks/ and examples/custom-tools/ with working examples. Examples are now bundled in npm and binary releases.
session_start and session_switch events with unified session event. Use event.reason ("start" | "switch" | "clear") to distinguish. Event now includes entries array for state reconstruction.--session flag not saving sessions in print mode (-p). The session manager was never receiving events because no subscriber was attached.--list-models [search] CLI flag to list available models with optional fuzzy search. Shows provider, model ID, context window, max output, thinking support, and image support. Only lists models with configured API keys. (#203)Tool output display: When collapsed, tool output now shows the last N lines instead of the first N lines, making streaming output more useful.
Updated @mariozechner/pi-ai with X-Initiator header support for GitHub Copilot, ensuring agent calls are not deducted from quota. (#200 by @kim0)
/think off now actually disables thinking for all providers. Previously, providers like Gemini with "dynamic thinking" enabled by default would still use thinking even when turned off. (#180 by @markusylisiurunen)@mariozechner/pi-ai with interleaved thinking enabled by default for Anthropic Claude 4 models.Dedicated to Peter's shoulder (@steipete)
@mariozechner/pi-ai with interleaved thinking support for Anthropic models./login -> "GitHub Copilot"). Supports both github.com and GitHub Enterprise. Models are sourced from models.dev and include Claude, GPT, Gemini, Grok, and more. All models are automatically enabled after login. (#191 by @cau1k)Inline image rendering: Terminals supporting Kitty graphics protocol (Kitty, Ghostty, WezTerm) or iTerm2 inline images now render images inline in tool output. Aspect ratio is preserved by querying terminal cell dimensions on startup. Toggle with /show-images command or terminal.showImages setting. Falls back to text placeholder on unsupported terminals or when disabled. (#177 by @nicobailon)
Gemini 3 Pro thinking levels: Thinking level selector now works with Gemini 3 Pro models. Minimal/low map to Google's LOW, medium/high map to Google's HIGH. (#176 by @markusylisiurunen)
Fixed read tool failing on macOS screenshot filenames due to Unicode Narrow No-Break Space (U+202F) in timestamp. Added fallback to try macOS variant paths and consolidated duplicate expandPath functions into shared path-utils.ts. (#181 by @nicobailon)
Fixed double blank lines rendering after markdown code blocks (#173 by @markusylisiurunen)
loadSkillsFromDir, formatSkillsForPrompt, and related types are now exported for use by other packages (e.g., mom).SKILL.md convention: Pi skills must now be named SKILL.md inside a directory, matching Codex CLI format. Previously any *.md file was treated as a skill. Migrate by renaming ~/.pi/agent/skills/foo.md to ~/.pi/agent/skills/foo/SKILL.md.Skills system: Auto-discover and load instruction files on-demand. Supports Claude Code (~/.claude/skills/*/SKILL.md), Codex CLI (~/.codex/skills/), and Pi-native formats (~/.pi/agent/skills/, .pi/skills/). Skills are listed in system prompt with descriptions, agent loads them via read tool when needed. Supports {baseDir} placeholder. Disable with --no-skills or skills.enabled: false in settings. (#169)
Version flag: Added --version / -v flag to display the current version and exit. (#170)
Auto-retry on transient errors: Automatically retries requests when providers return overloaded, rate limit, or server errors (429, 500, 502, 503, 504). Uses exponential backoff (2s, 4s, 8s). Shows retry status in TUI with option to cancel via Escape. Configurable in settings.json via retry.enabled, retry.maxRetries, retry.baseDelayMs. RPC mode emits auto_retry_start and auto_retry_end events. (#157)
HTML export line numbers: Read tool calls in HTML exports now display line number ranges (e.g., file.txt:10-20) when offset/limit parameters are used, matching the TUI display format. Line numbers appear in yellow color for better visibility. (#166)
Branch selector now works with single message: Previously the branch selector would not open when there was only one user message. Now it correctly allows branching from any message, including the first one. This is needed for checkpoint hooks to restore state from before the first message. (#163)
In-memory branching for --no-session mode: Branching now works correctly in --no-session mode without creating any session files. The conversation is truncated in memory.
Git branch indicator now works in subdirectories: The footer's git branch detection now walks up the directory hierarchy to find the git root, so it works when running pi from a subdirectory of a repository. (#156)
MISTRAL_API_KEY environment variable to use.-p) not exiting after output when custom themes are present (theme watcher now properly stops in print mode) (#161)Hooks system: TypeScript modules that extend agent behavior by subscribing to lifecycle events. Hooks can intercept tool calls, prompt for confirmation, modify results, and inject messages from external sources. Auto-discovered from ~/.pi/agent/hooks/*.ts and .pi/hooks/*.ts. Thanks to @nicobailon for the collaboration on the design and implementation. (#145, supersedes #158)
pi.send() API: Hooks can inject messages into the agent session from external sources (file watchers, webhooks, CI systems). If streaming, messages are queued; otherwise a new agent loop starts immediately.
--hook <path> CLI flag: Load hook files directly for testing without modifying settings.
Hook events: session_start, session_switch, agent_start, agent_end, turn_start, turn_end, tool_call (can block), tool_result (can modify), branch.
Hook UI primitives: ctx.ui.select(), ctx.ui.confirm(), ctx.ui.input(), ctx.ui.notify() for interactive prompts from hooks.
Hooks documentation: Full API reference at docs/hooks.md, shipped with npm package.
Simplified compaction flow: Removed proactive compaction (aborting mid-turn when threshold approached). Compaction now triggers in two cases only: (1) overflow error from LLM, which compacts and auto-retries, or (2) threshold crossed after a successful turn, which compacts without retry.
Compaction retry uses Agent.continue(): Auto-retry after overflow now uses the new continue() API instead of re-sending the user message, preserving exact context state.
Merged turn prefix summary: When a turn is split during compaction, the turn prefix summary is now merged into the main history summary instead of being stored separately.
isCompacting property on AgentSession: Check if auto-compaction is currently running.
Session compaction indicator: When resuming a compacted session, displays "Session compacted N times" status message.
Block input during compaction: User input is now blocked while auto-compaction is running to prevent race conditions.
Skip error messages in usage calculation: Context size estimation now skips both aborted and error messages, as neither have valid usage data.
--mode rpc) has been completely redesigned with a new JSON protocol. The old protocol is no longer supported. See docs/rpc.md for the new protocol documentation and test/rpc-example.ts for a working example. Includes RpcClient TypeScript class for easy integration. (#91)core/, modes/, utils/, cli/). Extracted AgentSession class as central session management abstraction. Split main.ts and tui-renderer.ts into focused modules. See DEVELOPMENT.md for the new code map. (#153)/debug command now includes agent messages as JSONL in the outputcurl downloading a video file)ReasoningEffort typethinkingXhigh and bashMode color tokens. The theme loader provides helpful error messages listing missing tokens. See built-in themes (dark.json, light.json) for reference values.OpenAI compatibility overrides in models.json: Custom models using openai-completions API can now specify a compat object to override provider quirks (supportsStore, supportsDeveloperRole, supportsReasoningEffort, maxTokensField). Useful for LiteLLM, custom proxies, and other non-standard endpoints. (#133, thanks @fink-andreas for the initial idea and PR)
xhigh thinking level: Added xhigh thinking level for OpenAI codex-max models. Cycle through thinking levels with Shift+Tab; xhigh appears only when using a codex-max model. (#143)
Collapse changelog setting: Add "collapseChangelog": true to ~/.pi/agent/settings.json to show a condensed "Updated to vX.Y.Z" message instead of the full changelog after updates. Use /changelog to view the full changelog. (#148)
Bash mode: Execute shell commands directly from the editor by prefixing with ! (e.g., !ls -la). Output streams in real-time, is added to the LLM context, and persists in session history. Supports multiline commands, cancellation (Escape), truncation for large outputs, and preview/expand toggle (Ctrl+O). Also available in RPC mode via {"type":"bash","command":"..."}. (#112, original implementation by @markusylisiurunen)
[Showing lines X-Y of Z. Use offset=N to continue]. If first line exceeds 50KB, suggests bash command[Showing lines X-Y of Z. Full output: /tmp/...]shellPath in settings.json, (2) Git Bash in standard locations, (3) any bash.exe on PATH. This enables Cygwin, MSYS2, and other bash environments. Configure with ~/.pi/agent/settings.json: {"shellPath": "C:\\cygwin64\\bin\\bash.exe"}.%7EBUN in addition to $bunfs and ~BUN in import.meta.url. This ensures the binary correctly locates supporting files (package.json, themes, etc.) next to the executable./branch selector for conversation branching.10.2M instead of 10184k). Context display shortened from 61.3% of 200k to 61.3%/200k.codexmax now finds gpt-5.1-codex-max). (#122 by @markusylisiurunen)/resume Command: Switch to a different session mid-conversation. Opens an interactive selector showing all available sessions. Equivalent to the --resume CLI flag but can be used without restarting the agent. (#117 by @hewliyang)-p flag now outputs error messages and exits with code 1 when requests fail, instead of silently producing no output.✔ or ›) that caused line width to exceed terminal width. Now uses proper truncateToWidth instead of substring.stripAnsi misses some sequences like standalone String Terminator (ESC \), which could cause rendering issues when displaying captured TUI output.authHeader option in models.json: Custom providers can set "authHeader": true to automatically add Authorization: Bearer <apiKey> header. Useful for providers that require explicit auth headers. (#81)--append-system-prompt Flag: Append additional text or file contents to the system prompt. Supports both inline text and file paths. Complements --system-prompt for layering custom instructions without replacing the base system prompt. (#114 by @markusylisiurunen)Ctrl+T shortcut to toggle visibility of LLM thinking blocks. When toggled off, shows a static "Thinking..." label instead of full content. Useful for reducing visual clutter during long conversations. (#113 by @markusylisiurunen)gpt-5.1-codex-max model support/copy Command: Copy the last agent message to clipboard. Works cross-platform (macOS, Windows, Linux). Useful for extracting text from rendered Markdown output. (#105 by @markusylisiurunen)/compact [instructions]: Manually compact context with optional custom instructions for the summary/autocompact: Toggle automatic compaction when context exceeds thresholdcontextWindow - reserveTokens (default 16k reserve)o key){"type":"compact"} command and auto-compaction (emits compaction events)branchedFrom in the session header, containing the path to the original session file. Useful for tracing session lineage.piConfig in package.json. Forks can change piConfig.name and piConfig.configDir to rebrand the CLI without code changes. Affects CLI banner, help text, config paths, and error messages. (#95)%7EBUN to $bunfs. (#95)gpt-4.1 (128K context)gpt-4.1-mini (128K context)gpt-4.1-nano (128K context)o3 (200K context, reasoning model)o4-mini (200K context, reasoning model)-p, --print Flag: Run in non-interactive batch mode. Processes input message or piped stdin without TUI, prints agent response directly to stdout. Ideal for scripting, piping, and CI/CD integration. Exits after first response.-P, --print-streaming Flag: Like -p, but streams response tokens as they arrive. Use --print-streaming --no-markdown for raw unformatted output.--print-turn Flag: Continue processing tool calls and agent turns until the agent naturally finishes or requires user input. Combine with -p for complete multi-turn conversations.--no-markdown Flag: Output raw text without Markdown formatting. Useful when piping output to tools that expect plain text.printStreaming option for streaming output in non-TUI mode.print Command: Send {"type":"print","content":"text"} to get formatted print output via print_output events.--continue.--thinking-off, --thinking-minimal, --thinking-low, --thinking-medium, --thinking-high flags for directly specifying thinking level without the selector UI.prompt wrapper command with direct message objects. Send {"role":"user","content":"text"} instead of {"type":"prompt","message":"text"}. Better aligns with message format throughout the codebase.timestamp auto-populated if missing./Users/foo/**/*.ts) are now handled correctly. Previously the leading / was being stripped, causing the pattern to be interpreted relative to the current directory.read tool can read from cwd, its ancestors (for config files), and all descendants. Symlinks are resolved before validation.--system-prompt <path> allowing the path argument to be captured by the message collection, causing "file not found" errors.edit tool.edit tool output: Shows only "Edited file.txt" for successful edits instead of verbose search/replace details.fd integration for file path autocompletion. Now uses fd for faster fuzzy file search.txt files in ~/.pi/slash-commands/. Files become /filename commands with first-line descriptions. Supports {{selection}} placeholder for referencing selected/attached content./branch Command: Create conversation branches from any previous user message. Opens a selector to pick a message, then creates a new session file starting from that point. Original message text is placed in the editor for modification.@path in messages and --file path CLI arguments now use the same attachment system with consistent MIME type detection./model command now opens a searchable list. Type to filter models by name, use arrows to navigate, Enter to select.@ now supports fuzzy matching and shows file/directory indicators.--resume and --session flags now open a searchable session list with fuzzy filtering.@path are now shown as "Attached: filename" in the user message, separate from the prompt text.@ symbol.@path syntax or --file flag@-references now handle special characters in file names (spaces, quotes, unicode)--rpc) for programmatic integration. Accepts JSON commands on stdin, emits JSON events on stdout. See RPC mode documentation for protocol details.~/.pi/settings.json, restored on startup. Per-session overrides saved in session files.Ctrl+I cycles through available models (or scoped models with -m flag).--system-prompt flag to override default system prompt with custom text or file contents.--models flag with -m/--model supporting multiple values. Specify models as provider/model@thinking (e.g., anthropic/claude-sonnet-4-20250514@high). Multiple -m flags scope available models for the session.Ctrl+O).~/.pi/models.jsonInitial public release.
--continue, --resume, and --session flagsread, write, edit, bash, glob, grep, think/thinking selector@ prefix/export command for HTML session export/model command for runtime model switching/session command for session statistics