New version of pi. Download from npm or view release on GitHub.
Breaking Changes
- Migrated first-party coding-agent code, SDK/examples/docs, and package metadata from
@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)
- Session-replacement commands now invalidate captured pre-replacement session-bound extension objects after
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.
Added
- Added support for terminating tool results via
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)
- Added OSC 9;4 terminal progress indicators during agent streaming and compaction, so terminals like iTerm2, WezTerm, Windows Terminal, and Kitty show activity in their tab bar
- Added
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)
Read more