pi v0.86.0 版本更新介绍
发布日期: 2026-09-19
版本号: v0.86.0
Pi v0.86.0 更新总结:新功能包括提示词缓存预热(长时间工具执行及空闲期间以成本感知方式维持缓存)、用 /bug 命令上报问题(自动打包脱敏诊断信息、可选会话记录或导出 ZIP)、基于会话记录的提示词与工具变更(恢复和分支跳转后仍保留指令工具改动并维持缓存前缀)、离线 Radius 模型目录、按模型配置压缩预留与保留 token 预算。破坏性变更:继承的 pi-ai 提供商流式输入由 Context 改为规范化的 TranscriptContext,自定义提供商需从 context.messages 通过 getCurrentSystemPrompt 与 getCurrentTools 读取系统提示和工具声明;ToolCall.arguments 与 ToolResultMessage.details 限定为 JSON 兼容值,ToolResultMessage 变为条件类型,JsonValue 数组改为只读;user_bash 改为失败即关闭,出错或结果非法时直接中止,不再调用后续处理器或本地执行。新增内容涵盖:会话记录支撑的中途系统提示与工具修改、Fireworks Messages 模型原生延迟工具加载、分支与压缩摘要及技能调用条目的点击折叠、Radius 公共模型目录、扩展用的 ctx.modelRegistry.stream 与 streamSimple、按模型的 compaction.modelOverrides 压缩参数、compat.allowedFallbackModels 覆盖 Anthropic 服务端回退模型、pi.on 返回取消订阅函数、导出扩展钩子相关类型、/bug 上报机制(打包环境模型提供商扩展与设置元数据并脱敏,上传 Radius 或导出 ZIP,崩溃记录在 crashes.json 并随下次上报附带)、成本感知的提示词缓存预热。改动项包括:–resume 会话结果渐进式显示、–continue 启动提速、用内置异步剪贴板助手替换外部原生剪贴板依赖、长文本模糊搜索改用原生子串搜索降低延迟、压缩与分支摘要及重试旋转指示器移入编辑器边框、内置工具默认启用严格优先的 JSON schema 采样、Bash 与 PowerShell 工具耗时按分秒及小时格式化、扩展编译器与虚拟模块延迟加载以降低 SDK 基线开销。修复项数量众多,主要涉及:GitHub Copilot GPT 系列模型改用 Responses 适配器、多家提供商的思考等级与签名思考回放问题、无正文 400/413 错误被误判为上下文溢出、Bedrock 一小时缓存写入按五分钟费率计费、排空 EventStream 缓冲事件时的二次方 CPU 占用、Mistral Medium 推理参数、OpenCode 与 OpenRouter 等会话标识头缺失、Codex Off 推理档位、Fireworks 推理档位与回退、DeepSeek 目录别名与定价刷新、OpenAI 兼容错误的提供商识别、Baseten 会话亲和头、Cloudflare 520 与 Azure 瞬时错误的重试分类、会话树导航与压缩进度 UI 竞争、按会话 ID 精确查找扫描全文、Anthropic 思考丢弃重复提示、阈值压缩跳过超大工具结果、被信号终止的本地命令误报成功、剪贴板失败误报成功、代理级重试退避上限、RPC steer 与 follow_up 绕过扩展 input 处理器、登录后过早报缺模型、全屏模式自定义页脚空行、无参数 schema 的扩展工具注册被拒、强制系统提示的拼接方式、llama.cpp 模型思考等级、多种取消竞态、Kitty 图片异步转换覆盖新图、技能斜杠命令补全排序、CJK 标点的文件补全边界与路径引号、LaTeX 字体切换与公式排版、WezTerm 中 Kitty 图片被清除。同时移除了 OpenAI Codex 中不可用的 GPT-5.4 与 GPT-5.4 mini 模型。
更新内容 (中文)
新功能
- 提示缓存预热 — 在长时间工具运行期间(可选地也包括空闲期间)通过成本感知刷新保持有价值的提示缓存存活。参见 缓存预热。
- 问题报告 — 使用
/bug报告问题,可附带脱敏诊断信息、可选的会话记录或导出的 ZIP 归档。参见 报告 Bug。 - 感知会话记录的提示与工具更新 — 在恢复和分支导航之间保留指令与工具变更,同时保留已缓存前缀。参见
before_agent_start。 - 离线 Radius 模型目录 — 可立即选择 Radius 模型,可用时会叠加缓存目录与实时目录。参见 Radius。
- 按模型设置压缩预算 — 按模型配置预留 token 预算与最近 token 预算。参见 按模型覆盖。
破坏性变更
- 将继承的 pi-ai provider 流输入从
Context更改为规范化的TranscriptContext值。自定义 provider 必须通过getCurrentSystemPrompt()和getCurrentTools()从context.messages读取系统提示与工具声明。参见 自定义流式 API。 - 将继承的
ToolCall.arguments和ToolResultMessage.details限制为 JSON 兼容值,将ToolResultMessage改为条件类型,并将JsonValue数组设为只读。 user_bash现在默认失败关闭:错误或无效的定义结果会中止命令,既不调用后续处理器,也不在本地执行。返回undefined以继续传播;否则返回{ operations }或{ result }(#9068)。
新增
- 新增基于会话记录的对话中途系统提示与工具变更,使指令和工具更新在恢复与分支导航后仍然保留,同时在受支持的模型上保留已缓存前缀。参见
before_agent_start和 条目类型(#9548)。 - 为 Fireworks Messages 模型新增继承的原生延迟工具加载。使用
ToolSearch或tool_search作为加载器名称以实现提示前缀延迟(#9323)。 - 为分支摘要、压缩摘要和技能调用条目新增点击展开/折叠。
- 新增公共 Radius 模型目录,支持立即与离线选择模型,可用时会叠加缓存目录与实时网关目录。
- 新增
ctx.modelRegistry.stream()和streamSimple(),用于通过已配置的 provider(含已解析的认证)进行扩展模型调用(#8964)。 - 通过
compaction.modelOverrides新增按模型的reserveTokens和keepRecentTokens设置,普通压缩设置作为回退(#8133)。 - 新增
compat.allowedFallbackModels配置,用于覆盖或禁用 Anthropic 服务端回退模型(#9294)。 pi.on()现在返回退订函数,使扩展可以移除事件处理器。在一次派发过程中添加或移除的处理器对后续派发生效,而非当前派发(#8967)。- 导出了此前从包入口点遗漏的扩展钩子事件与结果类型(#9642)。
- 新增
/bug [描述]用于向 Pi 开发者报告 bug。报告会打包环境、模型、provider、扩展与设置元数据(密钥已脱敏)、会话中的助手消息诊断信息,可选附带会话记录,或改为由模型撰写的故障摘要。报告会上传到 Radius(无需登录;登录后会标注归属),或导出为 zip 归档,报告 id 会以pi.bug-report条目记录在会话中。崩溃会记录在~/.pi/agent/crashes.json中,在下次启动时提示一次,并附加到下一份报告;无法解释的错误和耗尽的重试每个会话会提示一次/bug。 - 新增长时间工具运行期间(可选地也包括空闲期间)的成本感知提示缓存预热,包含可配置模式、模型缓存生命周期元数据、
/session诊断、会话记录通知以及cache_warming_decision扩展事件。参见 缓存预热(#9668)。
变更
--resume会话结果现在渐进式呈现,使用文件修改时间优先加载全部文件夹,并在选择后取消未完成的会话记录读取。- 通过按修改时间顺序检查候选会话头并在此会话为最新匹配项时停止,缩短了
--continue启动时间。 - 用内置的异步 macOS、Windows 和 X11 辅助程序替代外部原生剪贴板依赖,同时保留平台命令与 OSC 52 回退(#9163)。
- 通过使用原生子串搜索替代在 JavaScript 中逐字符扫描,降低继承的长文本模糊搜索延迟(#9267)。
- 将压缩、分支摘要与重试的加载动画移入编辑器边框,与工作指示器并列。自定义编辑器对所有状态加载动画使用相同的嵌入式选择加入。
- 默认为内置的
read、bash、powershell、edit和write工具启用严格优先的 JSON schema 采样,无需PI_EXPERIMENTAL。扩展可通过constrainedSampling: false重新注册工具定义。 - 将至少一分钟的 Bash 和 PowerShell 工具耗时格式化为分钟加秒,必要时显示小时(#9628)。
- 将扩展编译器与内置虚拟模块的加载延迟到文件系统扩展加载时,降低基线 SDK 导入开销(#9540)。
修复
- 修复 GitHub Copilot GPT 模型(包括 GPT-6 Astra)使用 Chat Completions 适配器而非所需的 Responses 适配器的问题(#9253,由 @petrroll 贡献)。
- 修复继承的 OpenRouter 与 OpenCode Go 上 DeepSeek V4.1 思考等级未保留 provider effort 元数据的问题(#9485)。
- 修复继承的非 Cerebras provider 返回的无正文 HTTP 400/413 错误被误判为上下文溢出的问题(#9482)。
- 修复继承的 Vercel AI Gateway 将未签名思考重放为助手文本的问题(#9676)。
- 修复继承的 Google Generative AI 与 Vertex AI 在省略推理或同一系列内模型能力不同时使用不受支持思考等级的问题(#9455)。
- 修复继承的 Anthropic 兼容中继在报告不同响应模型时破坏签名思考重放的问题,同时保留回退定价(#9188)。
- 修复继承的 Amazon Bedrock 一小时缓存写入按五分钟费率计价的问题(#9457)。
- 修复继承的清空缓冲
EventStream事件时 CPU 二次方增长的问题(#9055)。 - 修复继承的 Mistral Medium 推理请求对所有支持推理的
mistral-medium-*模型 ID 使用reasoning_effort而非不受支持的prompt_mode的问题(#8700)。 - 修复继承的 OpenCode 与 OpenCode Go 请求在所有受支持 API 适配器中从
sessionId发送x-opencode-session的问题(#9326)。 - 修复继承的 OpenAI Codex 请求发送模型的 Off 推理强度而非省略它的问题,同时尊重不受支持的 Off 映射(#9191)。
- 修复继承的 Fireworks 未签名思考重放及使用目录元数据选择推理强度的问题,包含经验证的 DeepSeek V4 与 Qwen3.8 回退,并移除冗余的 GLM 5.2 与 Kimi K3 effort 别名(#9323)。
- 修复继承的 OpenRouter 请求在启用提示缓存时对 Chat Completions 与 Anthropic Messages 模型从
sessionId发送x-session-id的问题(#9102)。 - 修复继承的 DeepSeek 目录为 DeepSeek V4.1 Flash 公布
deepseek-flash而非已退役的 Flash 别名,并刷新 DeepSeek 定价元数据(#9423)。 - 修复继承的 Mistral 托管 GLM-5.2 推理请求使用
reasoning_effort而非被忽略的prompt_mode的问题(#9375)。 - 修复继承的 OpenAI 兼容 Responses 错误始终标记为 OpenAI 错误而非识别实际 provider 的问题(#9298)。
- 修复继承的 Baseten 请求从
sessionId发送会话亲和头部以实现自动提示缓存路由的问题(#9629)。 - 修复继承的 Cloudflare 520 响应的重试分类(#9627)。
- 修复继承的 Azure 峰值负载瞬时错误的重试分类(#9669)。
- 修复会话树导航与进行中的压缩竞争并替换其进度 UI 的问题(#9179,由 @acmerfight 贡献)。
- 修复精确会话 ID 查找扫描完整会话记录正文而非读取会话头的问题(#9601,由 @metaist 贡献)。
- 修复对同一批被丢弃的思考块重复显示 Anthropic 思考丢弃通知的问题,并在会话中保留详情的同时缩短通知(#9391)。
- 修复运行中阈值压缩静默跳过超大尾部工具结果的问题(#9740)。
- 修复被信号终止的本地 shell 命令带着部分输出被报告为成功的问题(#9577,由 @BrendanJMurphy 贡献)。
- 修复本地剪贴板失败在终端忽略回退 OSC 52 写入时仍报告成功的问题,并在无剪贴板后端可用时新增平台特定的配置指引(#9618)。
- 将 agent 级重试退避上限设为
retry.maxAgentDelayMs(默认 60 秒),使长时间重试在持续瞬时故障期间仍保持响应(#8826)。 - 修复直接 RPC
steer与follow_up命令绕过扩展input处理器的问题(#8718)。 - 修复登录后过早出现模型缺失错误的问题,现在会等待目录发现完成。Radius 现在默认为
balanced,必要时回退到首个可用的 Radius 模型。 - 修复全屏模式为渲染零行的自定义页脚预留空白行的问题(#8919)。
- 修复无参数 schema 的扩展工具在注册时被拒绝而非破坏 provider 请求的问题(#9300)。
- 修复
before_agent_start处理器在带对话中途系统消息的模型上返回systemPrompt(及forceSystemPrompt)的问题:强制提示现在作为 provider 的首个系统提示发送,而非作为章节补丁追加到原提示之后。 - 修复已加载的带
enable_thinking聊天模板的 llama.cpp 模型忽略 Pi 思考等级的问题(#9528)。 - 修复可能触发自动压缩、留下过期重试状态,或在等待摘要认证期间漏掉取消的竞争问题(#9340、#9777)。
- 修复异步 Kitty 图像转换覆盖更新的部分工具输出图像的问题(#8743,由 @wutongyuonce 贡献)。
- 修复继承的技能斜杠命令自动补全对
skill:前缀而非裸技能名称排序的问题(#9120,由 @yearth 贡献)。 - 修复继承的文件自动补全在 CJK 标点周围的边界与路径引号问题(#9746,由 @haoqixu 贡献)。
- 修复继承的 LaTeX 传统字体切换回退到原始源码、
cases布局围绕周边公式居中,以及不支持与嵌套显示式脚本的垂直布局问题(#8827、#9564、#7929)。 - 修复继承的全屏 Kitty 图像在 WezTerm 中被后续行清除擦除的问题(#9169)。
移除
- 从 OpenAI Codex 选择中移除不可用的继承 GPT-5.4 与 GPT-5.4 mini 模型(#9394)。
更新内容 (原始)
New Features
- Prompt cache warming — Keep valuable prompt caches alive during long tool runs and optionally while idle using cost-aware refreshes. See Cache Warming.
- Bug reporting — Report problems with
/bugusing redacted diagnostics, optional transcripts, or exported ZIP archives. See Reporting Bugs. - Transcript-aware prompt and tool updates — Preserve instruction and tool changes across resume and branch navigation while retaining cached prefixes. See
before_agent_start. - Offline Radius model catalog — Select Radius models immediately, with cached and live catalogs overlaid when available. See Radius.
- Per-model compaction budgets — Configure reserved and recent-token budgets by model. See Per-model overrides.
Breaking Changes
- Changed inherited pi-ai provider stream inputs from
Contextto normalizedTranscriptContextvalues. Custom providers must read system prompts and tool declarations fromcontext.messageswithgetCurrentSystemPrompt()andgetCurrentTools(). See Custom Streaming API. - Restricted inherited
ToolCall.argumentsandToolResultMessage.detailsto JSON-compatible values, changedToolResultMessageinto a conditional type, and madeJsonValuearrays readonly. user_bashnow fails closed: errors or invalid defined results abort the command without invoking later handlers or executing locally. Returnundefinedto continue propagation; otherwise return{ operations }or{ result }(#9068).
Added
- Added transcript-backed mid-conversation system prompt and tool changes so instruction and tool updates survive resume and branch navigation while preserving cached prefixes on supported models. See
before_agent_startand Entry Types (#9548). - Added inherited native deferred tool loading for Fireworks Messages models. Use
ToolSearchortool_searchas the loader name for prompt-prefix deferral (#9323). - Added click toggling for branch summaries, compaction summaries, and skill invocation entries.
- Added the public Radius model catalog for immediate and offline model selection, with cached and live gateway catalogs overlaid when available.
- Added
ctx.modelRegistry.stream()andstreamSimple()for extension model calls through configured providers with resolved authentication (#8964). - Added per-model
reserveTokensandkeepRecentTokenssettings throughcompaction.modelOverrides, with ordinary compaction settings as fallback (#8133). - Added
compat.allowedFallbackModelsconfiguration for overriding or disabling Anthropic server-side fallback models (#9294). - Added an unsubscribe function from
pi.on()so extensions can drop event handlers. Handlers added or removed during a dispatch apply to later dispatches, not the current one (#8967). - Exported extension hook event and result types that were previously omitted from the package entry points (#9642).
- Added
/bug [description]to report a bug to the Pi developers. The report bundles environment, model, provider, extension, and settings metadata (secrets redacted), assistant message diagnostics from the session, optionally the session transcript, or a model-written summary of what went wrong instead. It is uploaded to Radius (no login required; attributed when logged in) or exported as a zip archive, and the report id is recorded in the session as api.bug-reportentry. Crashes are recorded in~/.pi/agent/crashes.json, announced once on the next start, and attached to the next report; unexplained errors and exhausted retries point at/bugonce per session. - Added cost-aware prompt-cache warming during long tool runs and optionally while idle, with configurable modes, model cache-lifetime metadata,
/sessiondiagnostics, transcript notices, and thecache_warming_decisionextension event. See Cache Warming (#9668).
Changed
- Made
--resumesession results appear progressively, using file modification times to prioritize all-folder loading and cancelling outstanding transcript reads after selection. - Reduced
--continuestartup time by checking candidate session headers in modification-time order and stopping after the newest matching session. - Replaced the external native clipboard dependency with bundled asynchronous macOS, Windows, and X11 helpers while preserving platform command and OSC 52 fallbacks (#9163).
- Reduced inherited fuzzy search latency for long texts by using native substring search instead of scanning each character in JavaScript (#9267).
- Moved compaction, branch summarization, and retry spinners into the editor border alongside the working indicator. Custom editors use the same embedding opt-in for all status spinners.
- Enabled strict-prefer JSON-schema sampling by default for built-in
read,bash,powershell,edit, andwritetools, without requiringPI_EXPERIMENTAL. Extensions can re-register tool definitions withconstrainedSampling: false. - Formatted Bash and PowerShell tool durations of at least one minute as minutes and seconds, with hours when needed (#9628).
- Deferred the extension compiler and bundled virtual modules until a filesystem extension is loaded, reducing the baseline SDK import cost (#9540).
Fixed
- Fixed GitHub Copilot GPT models, including GPT-6 Astra, using the Chat Completions adapter instead of the required Responses adapter (#9253 by @petrroll).
- Fixed inherited DeepSeek V4.1 thinking levels on OpenRouter and OpenCode Go preserving provider effort metadata (#9485).
- Fixed inherited bodyless HTTP 400/413 errors from non-Cerebras providers being misclassified as context overflow (#9482).
- Fixed inherited Vercel AI Gateway replaying unsigned thinking as assistant text (#9676).
- Fixed inherited Google Generative AI and Vertex AI using unsupported thinking levels when reasoning is omitted or when model capabilities differ within a Gemini family (#9455).
- Fixed inherited Anthropic-compatible relays breaking signed thinking replay when they report a different response model, while preserving fallback pricing (#9188).
- Fixed inherited Amazon Bedrock one-hour cache writes being priced at the five-minute rate (#9457).
- Fixed inherited quadratic CPU usage when draining buffered
EventStreamevents (#9055). - Fixed inherited Mistral Medium reasoning requests to use
reasoning_effortfor all reasoning-capablemistral-medium-*model IDs instead of the unsupportedprompt_mode(#8700). - Fixed inherited OpenCode and OpenCode Go requests to send
x-opencode-sessionfromsessionIdacross all supported API adapters (#9326). - Fixed inherited OpenAI Codex requests to send the model’s Off reasoning effort instead of omitting it, while respecting unsupported Off mappings (#9191).
- Fixed inherited Fireworks unsigned thinking replay and reasoning effort selection using catalog metadata, with verified DeepSeek V4 and Qwen3.8 fallbacks and removal of redundant GLM 5.2 and Kimi K3 effort aliases (#9323).
- Fixed inherited OpenRouter requests to send
x-session-idfromsessionIdfor Chat Completions and Anthropic Messages models when prompt caching is enabled (#9102). - Fixed the inherited DeepSeek catalog to advertise
deepseek-flashfor DeepSeek V4.1 Flash instead of retired Flash aliases, and refreshed DeepSeek pricing metadata (#9423). - Fixed inherited Mistral-hosted GLM-5.2 reasoning requests to use
reasoning_effortinstead of the ignoredprompt_mode(#9375). - Fixed inherited OpenAI-compatible Responses errors to identify the actual provider instead of always labeling them as OpenAI errors (#9298).
- Fixed inherited Baseten requests to send session-affinity headers from
sessionIdfor automatic prompt-cache routing (#9629). - Fixed inherited retry classification for Cloudflare 520 responses (#9627).
- Fixed inherited retry classification for transient Azure peak-load capacity errors (#9669).
- Fixed session tree navigation racing with active compaction and replacing its progress UI (#9179 by @acmerfight).
- Fixed exact session ID lookup scanning complete transcript bodies instead of reading session headers (#9601 by @metaist).
- Fixed repeated Anthropic thinking-drop notices being shown for the same dropped blocks, and shortened notices while retaining details in the session (#9391).
- Fixed mid-run threshold compaction silently skipping oversized trailing tool results (#9740).
- Fixed signal-terminated local shell commands being reported as successful with partial output (#9577 by @BrendanJMurphy).
- Fixed local clipboard failures reporting success when the terminal ignored the fallback OSC 52 write, and added platform-specific setup guidance when no clipboard backend works (#9618).
- Capped agent-level retry backoff at
retry.maxAgentDelayMs(60s by default) so long retry runs stay responsive during prolonged transient outages (#8826). - Fixed direct RPC
steerandfollow_upcommands bypassing extensioninputhandlers (#8718). - Fixed premature missing-model errors after login by waiting for catalog discovery. Radius now defaults to
balanced, falling back to the first available Radius model when needed. - Fixed fullscreen mode reserving a blank row for custom footers that render zero rows (#8919).
- Fixed extension tools without parameter schemas to be rejected during registration instead of breaking provider requests (#9300).
- Fixed
before_agent_starthandlers returningsystemPrompt(andforceSystemPrompt) on models with mid-conversation system messages: the forced prompt is now sent as the provider’s leading system prompt instead of being appended as a section patch after the original prompt. - Fixed loaded llama.cpp models with
enable_thinkingchat templates ignoring Pi’s thinking level (#9528). - Fixed cancellation races that could start automatic compaction, leave stale retry state, or miss cancellation while waiting for summarization authentication (#9340, #9777).
- Fixed asynchronous Kitty image conversion replacing newer partial tool output images (#8743 by @wutongyuonce).
- Fixed inherited skill slash-command autocomplete ranking the
skill:prefix instead of the bare skill name (#9120 by @yearth). - Fixed inherited file autocomplete boundaries and path quoting around CJK punctuation (#9746 by @haoqixu).
- Fixed inherited LaTeX legacy font switches falling back to raw source, centered
caseslayouts around surrounding equations, and vertically laid out unsupported and nested display scripts (#8827, #9564, #7929). - Fixed inherited fullscreen Kitty images being erased by later row clears in WezTerm (#9169).
Removed
- Removed unavailable inherited GPT-5.4 and GPT-5.4 mini models from OpenAI Codex selection (#9394).