← 返回更新日志

Pi v0.86.0

2026-09-19 · GitHub 原文
### 新增功能 - **提示词缓存预热** — 在长时间的工具运行期间保持有价值的提示词缓存存活,并可选择在空闲时使用成本感知的刷新机制。参见 [缓存预热](https://github.com/earendil-works/pi/blob/v0.86.0/packages/coding-agent/docs/settings.md#cache-warming)。 - **错误报告** — 使用 `/bug` 命令报告问题,支持脱敏的诊断信息、可选的会话记录或导出的 ZIP 归档文件。参见 [错误报告](https://github.com/earendil-works/pi/blob/v0.86.0/packages/coding-agent/docs/sessions.md#reporting-bugs)。 - **基于会话记录的提示词与工具更新** — 在恢复会话和分支导航期间保留指令和工具的更改,同时保留已缓存的前缀。参见 [`before_agent_start`](https://github.com/earendil-works/pi/blob/v0.86.0/packages/coding-agent/docs/extensions.md#before_agent_start)。 - **离线 Radius 模型目录** — 立即选择 Radius 模型,在可用时叠加缓存目录和实时目录。参见 [Radius](https://github.com/earendil-works/pi/blob/v0.86.0/packages/coding-agent/docs/providers.md#radius)。 - **按模型配置的压缩预算** — 按模型配置保留预算和近期令牌预算。参见 [按模型覆盖](https://github.com/earendil-works/pi/blob/v0.86.0/packages/coding-agent/docs/compaction.md#per-model-overrides)。 ### 不兼容变更 - 将继承的 pi-ai 提供商流输入从 `Context` 更改为标准化 `TranscriptContext` 值。自定义提供商必须使用 `getCurrentSystemPrompt()` 和 `getCurrentTools()` 从 `context.messages` 读取系统提示词和工具声明。参见 [自定义流式 API](https://github.com/earendil-works/pi/blob/v0.86.0/packages/coding-agent/docs/custom-provider.md#custom-streaming-api)。 - 将继承的 `ToolCall.arguments` 和 `ToolResultMessage.details` 限制为 JSON 兼容值,将 `ToolResultMessage` 更改为条件类型,并将 `JsonValue` 数组设为只读。 - `user_bash` 现在采用失败关闭策略:错误或无效的定义结果将中止命令,不会调用后续处理器或在本地执行。返回 `undefined` 以继续传播;否则返回 `{ operations }` 或 `{ result }` ([#9068](https://github.com/earendil-works/pi/issues/9068))。 ### 新增 - 添加了基于会话记录的会话中系统提示词和工具更改,使指令和工具更新在恢复和分支导航期间得以保留,同时在支持的模型上保留缓存前缀。参见 [`before_agent_start`](https://github.com/earendil-works/pi/blob/v0.86.0/packages/coding-agent/docs/extensions.md#before_agent_start) 和 [条目类型](https://github.com/earendil-works/pi/blob/v0.86.0/packages/coding-agent/docs/session-format.md#entry-types) ([#9548](https://github.com/earendil-works/pi/pull/9548))。 - 为 Fireworks Messages 模型添加了继承的原生延迟工具加载。使用 `ToolSearch` 或 `tool_search` 作为提示词前缀延迟的加载器名称 ([#9323](https://github.com/earendil-works/pi/issues/9323))。 - 为分支摘要、压缩摘要和技能调用条目添加了点击切换功能。 - 添加了公共 Radius 模型目录,支持即时和离线模型选择,在可用时叠加缓存目录和实时网关目录。 - 添加了 `ctx.modelRegistry.stream()` 和 `streamSimple()`,用于通过已配置且认证已解析的提供商进行扩展模型调用 ([#8964](https://github.com/earendil-works/pi/issues/8964))。 - 通过 `compaction.modelOverrides` 添加了按模型的 `reserveTokens` 和 `keepRecentTokens` 设置,普通压缩设置作为回退 ([#8133](https://github.com/earendil-works/pi/issues/8133))。 - 添加了 `compat.allowedFallbackModels` 配置,用于覆盖或禁用 Anthropic 服务端回退模型 ([#9294](https://github.com/earendil-works/pi/issues/9294))。 - 为 `pi.on()` 添加了取消订阅函数,以便扩展程序可以移除事件处理器。在分发期间添加或移除的处理器将应用于后续分发,而非当前分发 ([#8967](https://github.com/earendil-works/pi/issues/8967))。 - 导出了之前从包入口点中遗漏的扩展钩子事件和结果类型 ([#9642](https://github.com/earendil-works/pi/pull/9642))。 - 添加了 `/bug [description]` 命令,用于向 Pi 开发者报告错误。报告将打包环境、模型、提供商、扩展和设置元数据(已脱敏密钥)、会话中的助手消息诊断信息,可选会话记录,或改为由模型生成的错误摘要。报告将上传至 Radius(无需登录;登录时带归属)或导出为 zip 归档文件,报告 ID 将作为 `pi.bug-report` 条目记录在会话中。崩溃信息记录在 `~/.pi/agent/crashes.json` 中,下次启动时通知一次,并附加到下一次报告;无法解释的错误和重试耗尽的情况将在每次会话中指向 `/bug` 一次。 - 在长时间工具运行期间及可选的空闲期间添加了成本感知的提示词缓存预热功能,支持可配置模式、模型缓存生命周期元数据、`/session` 诊断信息、会话记录通知以及 `cache_warming_decision` 扩展事件。参见 [缓存预热](https://github.com/earendil-works/pi/blob/v0.86.0/packages/coding-agent/docs/settings.md#cache-warming) ([#9668](https://github.com/earendil-works/pi/pull/9668))。 ### 更改 - 使 `--resume` 会话结果逐步显示,通过文件修改时间优先加载整个文件夹,并在选择后取消待处理的转录读取。 - 通过按修改时间顺序检查候选会话头,并在找到最新匹配会话后停止,从而缩短 `--continue` 的启动时间。 - 使用内置的异步 macOS、Windows 和 X11 辅助工具替换了外部原生剪贴板依赖,同时保留平台命令和 OSC 52 回退机制 ([#9163](https://github.com/earendil-works/pi/pull/9163))。 - 通过改用原生子串搜索而非在 JavaScript 中逐个扫描字符,降低了长文本的继承模糊搜索延迟 ([#9267](https://github.com/earendil-works/pi/issues/9267))。 - 将压缩、分支摘要和重试的加载动画移至编辑器边框,与工作状态指示器并列。自定义编辑器对所有状态加载动画使用相同的嵌入选项。 - 默认对内置的 `read`、`bash`、`powershell`、`edit` 和 `write` 工具启用严格优先的 JSON 模式采样,无需设置 `PI_EXPERIMENTAL`。扩展程序可通过 `constrainedSampling: false` 重新注册工具定义。 - 将 Bash 和 PowerShell 工具运行时长至少为一分钟的情况格式化为“分:秒”,必要时显示小时 ([#9628](https://github.com/earendil-works/pi/issues/9628))。 - 将扩展编译器和捆绑的虚拟模块的加载推迟到文件系统扩展加载之后,从而降低基础 SDK 导入成本 ([#9540](https://github.com/earendil-works/pi/issues/9540))。 ### 修复 - 修复了 GitHub Copilot GPT 模型(包括 GPT-6 Astra)错误使用 Chat Completions 适配器而非必需的 Responses 适配器的问题 ([#9253](https://github.com/earendil-works/pi/pull/9253),由 [@petrroll](https://github.com/petrroll) 贡献)。 - 修复了 OpenRouter 和 OpenCode Go 上继承的 DeepSeek V4.1 思考级别未能保留提供商努力元数据的问题 ([#9485](https://github.com/earendil-works/pi/issues/9485))。 - 修复了非 Cerebras 提供商返回的无内容 HTTP 400/413 错误被错误分类为上下文溢出(context overflow)的问题 ([#9482](https://github.com/earendil-works/pi/issues/9482))。 - 修复了 Vercel AI Gateway 将未签名的思考内容错误重放为助手文本的问题 ([#9676](https://github.com/earendil-works/pi/issues/9676))。 - 修复了 Google Generative AI 和 Vertex AI 在省略推理或 Gemini 系列模型能力不同时使用不支持的思考级别的问题 ([#9455](https://github.com/earendil-works/pi/issues/9455))。 - 修复了 Anthropic 兼容中继在报告不同响应模型时破坏签名思考重放的问题,同时保留了回退定价机制 ([#9188](https://github.com/earendil-works/pi/issues/9188))。 - 修复了 Amazon Bedrock 一小时缓存写入被错误按五分钟费率计费的问题 ([#9457](https://github.com/earendil-works/pi/issues/9457))。 - 修复了处理缓冲的 `EventStream` 事件时出现二次方 CPU 使用率飙升的问题 ([#9055](https://github.com/earendil-works/pi/issues/9055))。 - 修复了 Mistral Medium 推理请求,使其对所有支持推理的 `mistral-medium-*` 模型 ID 使用 `reasoning_effort` 而非不支持的 `prompt_mode` ([#8700](https://github.com/earendil-works/pi/issues/8700))。 - 修复了 OpenCode 和 OpenCode Go 请求,使其在所有支持的 API 适配器中都能从 `sessionId` 正确发送 `x-opencode-session` 头 ([#9326](https://github.com/earendil-works/pi/issues/9326))。 - 修复了 OpenAI Codex 请求,使其发送模型的“关闭”推理努力值而非省略它,同时正确处理不支持的 Off 映射 ([#9191](https://github.com/earendil-works/pi/issues/9191))。 - 修复了 Fireworks 未签名思考重放和推理努力选择逻辑,改用目录元数据,验证了 DeepSeek V4 和 Qwen3.8 的回退机制,并移除了冗余的 GLM 5.2 和 Kimi K3 努力别名 ([#9323](https://github.com/earendil-works/pi/issues/9323))。 - 修复了 OpenRouter 请求,在启用提示词缓存时,为 Chat Completions 和 Anthropic Messages 模型从 `sessionId` 正确发送 `x-session-id` ([#9102](https://github.com/earendil-works/pi/issues/9102))。 - 修复了继承的 DeepSeek 目录,使其为 DeepSeek V4.1 Flash 正确标识为 `deepseek-flash` 而非已废弃的 Flash 别名,并更新了 DeepSeek 定价元数据 ([#9423](https://github.com/earendil-works/pi/issues/9423))。 - 修复了 Mistral 托管的 GLM-5.2 推理请求,使其使用 `reasoning_effort` 而非被忽略的 `prompt_mode` ([#9375](https://github.com/earendil-works/pi/issues/9375))。 - 修复了 OpenAI 兼容的 Responses 错误识别逻辑,使其正确标识实际提供商,而非一律标记为 OpenAI 错误 ([#9298](https://github.com/earendil-works/pi/issues/9298))。 - 修复了 Baseten 请求,使其从 `sessionId` 正确发送会话亲和性头,以实现自动提示词缓存路由 ([#9629](https://github.com/earendil-works/pi/issues/9629))。 - 修复了 Cloudflare 520 响应的继承重试分类逻辑 ([#9627](https://github.com/earendil-works/pi/issues/9627))。 - 修复了 Azure 瞬时峰值负载容量错误的继承重试分类逻辑 ([#9669](https://github.com/earendil-works/pi/issues/9669))。 - 修复了会话树导航与活动压缩操作竞争,并替换其进度 UI 的问题 ([#9179](https://github.com/earendil-works/pi/pull/9179),由 [@acmerfight](https://github.com/acmerfight) 贡献)。 - 修复了精确会话 ID 查找时扫描完整转录体而非读取会话头的问题 ([#9601](https://github.com/earendil-works/pi/pull/9601),由 [@metaist](https://github.com/metaist) 贡献)。 - 修复了对同一丢弃块重复显示 Anthropic 思考丢弃通知的问题,缩短了通知内容,同时在会话中保留详细信息 ([#9391](https://github.com/earendil-works/pi/issues/9391))。 - 修复了运行中阈值压缩静默跳过过大尾部工具结果的问题 ([#9740](https://github.com/earendil-works/pi/issues/9740))。 - 修复了被信号终止的本地 shell 命令被错误报告为成功且仅输出部分结果的问题 ([#9577](https://github.com/earendil-works/pi/issues/9577) by [@BrendanJMurphy](https://github.com/BrendanJMurphy))。 - 修复了当终端忽略回退的 OSC 52 写入时本地剪贴板失败仍报告成功的问题,并在所有剪贴板后端均不可用时添加了特定平台的设置指南 ([#9618](https://github.com/earendil-works/pi/issues/9618))。 - 将代理级别的重试退避时间上限限制在 `retry.maxAgentDelayMs`(默认 60 秒),以确保在长时间的短暂故障期间长重试任务仍能保持响应 ([#8826](https://github.com/earendil-works/pi/issues/8826))。 - 修复了直接 RPC `steer` 和 `follow_up` 命令绕过扩展 `input` 处理器的问题 ([#8718](https://github.com/earendil-works/pi/issues/8718))。 - 通过等待目录发现修复了登录后过早出现的模型缺失错误。Radius 现默认设置为 `balanced`,在需要时回退到第一个可用的 Radius 模型。 - 修复了全屏模式下为渲染零行的自定义页脚预留空白行的问题 ([#8919](https://github.com/earendil-works/pi/issues/8919))。 - 修复了注册时未拒绝缺少参数架构的扩展工具,从而避免破坏提供者请求的问题 ([#9300](https://github.com/earendil-works/pi/issues/9300))。 - 修复了 `before_agent_start` 处理器在支持对话中间系统消息的模型上返回 `systemPrompt`(及 `forceSystemPrompt`)的问题:强制提示词现作为提供者的前置系统提示词发送,而非追加到原始提示词之后作为区块补丁。 - 修复了加载的 llama.cpp 模型在使用 `enable_thinking` 聊天模板时忽略 Pi 思考等级的问题 ([#9528](https://github.com/earendil-works/pi/issues/9528))。 - 修复了可能导致启动自动压缩、遗留陈旧重试状态或在等待摘要认证时错过取消请求的取消竞态条件 ([#9340](https://github.com/earendil-works/pi/issues/9340), [#9777](https://github.com/earendil-works/pi/issues/9777))。 - 修复了异步 Kitty 图像转换替换较新的部分工具输出图像的问题 ([#8743](https://github.com/earendil-works/pi/pull/8743) by [@wutongyuonce](https://github.com/wutongyuonce))。 - 修复了继承的技能斜杠命令自动补全将 `skill:` 前缀排在技能裸名前的问题 ([#9120](https://github.com/earendil-works/pi/pull/9120) by [@yearth](https://github.com/yearth))。 - 修复了继承的文件自动补全边界及 CJK 标点符号周围的路径引用问题 ([#9746](https://github.com/earendil-works/pi/pull/9746) by [@haoqixu](https://github.com/haoqixu))。 - 修复了继承的 LaTeX 旧版字体切换回退到原始源码、将 `cases` 布局居中于周围公式,以及垂直排列不支持和嵌套的显示脚本的问题 ([#8827](https://github.com/earendil-works/pi/issues/8827), [#9564](https://github.com/earendil-works/pi/issues/9564), [#7929](https://github.com/earendil-works/pi/issues/7929))。 - 修复了继承的全屏 Kitty 图像被 WezTerm 中后续的行清除操作擦除的问题 ([#9169](https://github.com/earendil-works/pi/issues/9169))。 ### 已移除 - 从 OpenAI Codex 选择中移除了不可用的继承 GPT-5.4 和 GPT-5.4 mini 模型 ([#9394](https://github.com/earendil-works/pi/issues/9394))。