New Features
- Runtime tool registration now applies immediately in active sessions. Tools registered via
pi.registerTool()after startup are available topi.getAllTools()and the LLM without/reload(docs/extensions.md, examples/extensions/dynamic-tools.ts, #1720). - Tool definitions can customize the default system prompt with
promptSnippet(Available tools) andpromptGuidelines(Guidelines) while the tool is active (docs/extensions.md, #1720). - Custom tool renderers can suppress transcript output without leaving extra spacing or empty transcript footprint in interactive rendering (docs/extensions.md, #1719).
Added
- Added optional
promptSnippettoToolDefinitionfor one-line entries in the default system prompt'sAvailable toolssection. Active extension tools appear there when registered and active (#1237 by @semtexzv). - Added optional
promptGuidelinestoToolDefinitionso active tools can append tool-specific bullets to the default system promptGuidelinessection (#1720).
Fixed
- Fixed
pi.registerTool()dynamic registration after session initialization. Tools registered insession_startand later handlers now refresh immediately, become active, and are visible to the LLM without/reload(#1720) - Fixed session message persistence ordering by serializing
AgentSessionevent processing, preventingtoolResultentries from being written before their corresponding assistant tool-call messages when extension handlers are asynchronous (#1717) - Fixed spacing artifacts when custom tool renderers intentionally suppress per-call transcript output, including extra blank rows in interactive streaming and non-zero transcript footprint for empty custom renders (#1719 by @alasano)
- Fixed
session.prompt()returning before retry completion by creating the retry promise synchronously atagent_enddispatch, which closes a race when earlier queued event handlers are async (#1726 by @pasky)