pi coding agent v1.4.0:Codemode支持排队、摘要突破固定上限、默认模型更新
v1.4.0
推荐理由
v1.4.0 引入了 Codemode 排队机制并移除了摘要生成的硬性 Token 上限,显著改善了长上下文处理体验;同时默认模型有实质性切换,重度用户务必升级以适配新行为。
New Features
新功能
- Image input for classifiers: codemode models.classify() accepts images for TypeSafe's Jev and Cloudflare's Clef models on typesafe, cloudflare-workers-ai, and OpenRouter. See Use classifier models and Codemode.
- Models Configuration reference: every provider, model, model override, and compatibility field of models.json, generated from its schema. See Models Configuration.
- Summaries without a fixed output cap: compaction and branch summaries use the model's output limit, so long reasoning no longer makes them fail. See Compaction.
- Codemode waits for a free worker: parallel scripts and in-process subagents queue instead of failing, and PI_CODEMODE_MAX_WORKERS raises the limit. See Codemode limits.
- Rex terminal support: OSC 8 hyperlinks, truecolor, and inline images.
- 分类器的图像输入:codemode models.classify() 接受图像,适用于 typesafe、cloudflare-workers-ai 和 OpenRouter 上的 TypeSafe 的 Jev 模型和 Cloudflare 的 Clef 模型。参见使用分类器模型和 Codemode。
- 模型配置参考:models.json 的所有提供程序、模型、模型覆盖和兼容性字段,由其模式生成。参见模型配置。
- 无固定输出上限的摘要:压缩和分支摘要使用模型的输出限制,因此长推理不再导致它们失败。参见压缩。
- Codemode 等待空闲工作进程:并行脚本和进程内子代理进行排队而不是失败,PI_CODEMODE_MAX_WORKERS 提高限制。参见 Codemode 限制。
- Rex 终端支持:OSC 8 超链接、真彩色和内联图像。
Added
新增
- Added a Models Configuration reference generated from the models.json schema, listing all provider, model, model override, and compatibility fields (#10790)
- Codemode models.classify() now accepts images for TypeSafe's Jev and Cloudflare's Clef models on typesafe, cloudflare-workers-ai, and OpenRouter, and lists Clef Omni and Jev 1.14 on Workers AI.
- Provider-level compat in models.json now also applies to classifier models, with the System One fields imageInput and sendImageOptInHeader for proxies that serve another service's classifiers. Extension classifier models accept compat too.
- Added MiniMax-M3.1-Flash to the minimax and minimax-cn providers, with thinking levels low through max (#11121)
- Added support for the Rex terminal: OSC 8 hyperlinks, truecolor, and inline images (#11131, #11150 by @petrroll, #11183 by @nihaals)
- 新增了由 models.json 模式生成的模型配置参考,列出所有提供程序、模型、模型覆盖和兼容性字段 (#10790)
- Codemode models.classify() 现在接受图像,适用于 typesafe、cloudflare-workers-ai 和 OpenRouter 上的 TypeSafe 的 Jev 模型和 Cloudflare 的 Clef 模型,并在 Workers AI 上列出 Clef Omni 和 Jev 1.14。
- models.json 中的提供程序级兼容性现在也适用于分类器模型,对于为其他服务提供分类器的代理,包含 System One 字段 imageInput 和 sendImageOptInHeader。扩展分类器模型也接受兼容性设置。
- 向 minimax 和 minimax-cn 提供程序添加了 MiniMax-M3.1-Flash,思考级别从 low 到 max (#11121)
- 新增对 Rex 终端的支持:OSC 8 超链接、真彩色和内联图像 (#11131, #11150 by @petrroll, #11183 by @nihaals)
Changed
更改
- Provider attribution headers now come from pi-ai's client identity. Extensions' before_provider_headers handlers no longer see the OpenRouter, NVIDIA NIM, and OpenCode attribution headers; returning null for one still removes it. Cloudflare requests send pi's detailed User-Agent instead of pi-coding-agent, as do GitHub release checks for tool downloads, and OpenCode requests send x-opencode-client whenever attribution is enabled, not only with a session.
- generateSummary() and generateSummaryWithUsage() now ignore their reserveTokens parameter. Summary requests use the model's output limit instead.
- Changed the default GitHub Copilot model from gpt-5.4, which Copilot retired, to gpt-6.1-sol.
- Changed the default NVIDIA model to nvidia/nemotron-3.5-super-vl-120b-a12b (#10910 by @cv)
- Changed the default Xiaomi model to mimo-v2.6-pro for the xiaomi and Xiaomi Token Plan providers, since mimo-v2.5-pro left the catalog.
- Grok 4.3 and Grok 4.5 on the xai provider now offer the xhigh thinking level.
- Sign in with ChatGPT: ChatGPT Business workspace usage-limit errors are not retried and tell the user to ask their workspace admin to increase the limit.
- 提供程序归属标头现在来自 pi-ai 的客户端身份。扩展程序的 before_provider_headers 处理程序不再看到 OpenRouter、NVIDIA NIM 和 OpenCode 的归属标头;返回 null 仍会移除它。Cloudflare 请求发送 pi 的详细 User-Agent 而不是 pi-coding-agent,GitHub 工具下载的检查也是如此,当启用归属时,OpenCode 请求发送 x-opencode-client,而不仅是在会话中。
- generateSummary() 和 generateSummaryWithUsage() 现在忽略其 reserveTokens 参数。摘要请求改用模型的输出限制。
- 将默认 GitHub Copilot 模型从已停用的 gpt-5.4 更改为 gpt-6.1-sol。
- 将默认 NVIDIA 模型更改为 nvidia/nemotron-3.5-super-vl-120b-a12b (#10910 by @cv)
- 由于 mimo-v2.5-pro 已退出目录,已将 xiaomi 和 Xiaomi Token Plan 提供商的默认小米模型更改为 mimo-v2.6-pro。
- xai 提供商上的 Grok 4.3 和 Grok 4.5 现在提供 xhigh 思考级别。
- 使用 ChatGPT 登录:ChatGPT Business 工作区的使用限制错误不会重试,并提示用户联系其工作区管理员以提高限制。
Fixed
已修复
- Fixed compaction and branch summaries failing with "generation hit the token cap" when reasoning used most of the fixed summary output limit. Summaries now use the model's output limit, and compaction.reserveTokens only controls when compaction starts (#9512, #9075).
- Fixed models.schema.json missing descriptions for provider and model fields, so editors showed no hints for them (#10790)
- Fixed pi update failing with "Managed install marker is missing or invalid" when managed-install.json starts with a UTF-8 BOM, which Windows PowerShell 5.1 adds when it rewrites the file.
- Fixed HTML export showing literal asterisks for Markdown bold and italic next to CJK punctuation (#3353, #10154)
- Fixed the terminal staying in mouse-tracking, focus-reporting, Kitty keyboard, and alternate-screen modes when pi exits without its normal terminal teardown, which flooded the shell prompt with escape sequences (#11170)
- Fixed concurrent extension select/confirm/input/editor dialogs and inline custom() components in interactive mode: a second dialog replaced the first and the first promise never settled; closing the visible dialog now shows the previous one again (#11166, #9909)
- Fixed pasting in the shell hanging after copying text in pi and suspending it with Ctrl+Z on Linux: the background wl-copy/xclip/xsel process that keeps serving the clipboard was suspended along with pi (#11179)
- Fixed codemode scripts failing immediately when both codemode workers are busy, for example with parallel codemode calls or in-process subagents. Scripts now wait up to 60 seconds for a free worker, and PI_CODEMODE_MAX_WORKERS raises the limit of two workers (#11184)
- Fixed extensions failing to load when importing @earendil-works/pi-ai/models (e.g. for clampThinkingLevel) by exposing the subpath through the extension loader aliases and virtual modules (#11156)
- Fixed mcp.json files that start with a UTF-8 BOM failing to parse, which skipped all their MCP servers and made pi mcp add/pi mcp remove fail (#11191)
- Fixed /compact <instructions> ignoring the instructions when summarizing the start of a turn that compaction splits. When the split turn was the only new content since the last compaction, the instructions were ignored entirely (#11058)
- Fixed resumed sessions and /tree navigation leaving extension tools inactive when the branch recorded its tools before they were registered, such as tools from extensions installed after the session started. Extension tools the branch never added or removed are now active unless they are registered with defaultActive: false (#11062, #11075)
- Fixed sessions breaking after recovery from a response cut off at the output limit: the truncated tool call was omitted but its tool results were kept, so providers rejected every later request (#11227, #11233 by @petrroll)
- Fixed the grep tool following RIPGREP_CONFIG_PATH, where options such as --fixed-strings silently changed regex searches into literal ones. The tool now runs rg --no-config (#11203, #11230 by @petrroll)
- Fixed Windows shell detection rejecting runnable Microsoft Store shell aliases (#9504 by @petrroll)
- Fixed Windows shell detection missing PowerShell outside PATH and the legacy WSL bash.exe launcher when Windows is not installed in C:\Windows. pi now checks %ProgramFiles%\PowerShell\7, %SystemRoot%\System32\WindowsPowerShell\v1.0, and %SystemRoot% (#9501 by @petrroll)
- Fixed GitHub Copilot sessions with large request bodies, such as many images, failing with HTTP 413 failed to parse request instead of compacting and retrying (#11016 by @petrroll)
- Fixed the openai-codex provider offering gpt-5.5 and gpt-5.3-codex-spark, which always fail for ChatGPT accounts (#11173 by @lucasmeijer)
- Fixed whitespace-only tool output (for example a bare \r\n from bash) making OpenAI Completions, OpenAI Responses, and Google requests fail with a 400 (#8720)
- Fixed automatic retry not triggering for more gateway upstream failures, stream disconnected before completion errors relayed by Codex CLI proxies, and transient Google Vertex OAuth token refresh failures, and retrying errors because of digits inside request ids or byte counts (#10920, #11057, #10996)
- Fixed OpenAI Responses models losing the prompt cache on every deferred tool load after a tool was removed (#10940)
- Fixed Cloudflare Workers AI classifier pricing: Clef Flash costs $0.038 and Jev $0.042 per million input tokens instead of Jev being listed as free.
- Fixed an unclosed $$ display-math block swallowing or corrupting every Markdown table after it (#11159)
- Fixed Markdown bold and italic not rendering next to CJK punctuation (#10730 by @theBucky)
- Fixed @ file autocomplete returning no results for queries containing regex metacharacters such as [ or ( (#10972)
- 修复了在推理使用了大部分固定摘要输出限制时,压缩(compaction)和分支摘要因“生成达到令牌上限”而失败的问题。摘要现在使用模型的输出限制,且 compaction.reserveTokens 仅控制压缩何时开始(#9512、#9075)。
- 修复了 models.schema.json 中缺少 provider 和 model 字段的描述,导致编辑器未显示相关提示(#10790)
- 修复了当 managed-install.json 以 UTF-8 BOM 开头时 pi 更新失败并报错“Managed install marker is missing or invalid”的问题,Windows PowerShell 5.1 在重写文件时会添加该 BOM。
- 修复了 HTML 导出中 Markdown 粗体和斜体旁边的 CJK 标点符号显示为字面量星号的问题(#3353、#10154)
- 修复了当 pi 在没有正常终端清理的情况下退出时,终端保持在鼠标跟踪、焦点报告、Kitty 键盘和备用屏幕模式中的问题,这会导致 shell 提示符被转义序列淹没(#11170)
- 修复了交互模式下并发扩展选择/确认/输入/编辑器对话框和内联 custom() 组件的问题:第二个对话框替换了第一个,且第一个承诺从未解决;关闭可见对话框现在会重新显示前一个对话框(#11166、#9909)
- 修复了在 Linux 上复制文本后在 pi 中挂起它(使用 Ctrl+Z),然后在 shell 中粘贴时挂起的问题:后台 wl-copy/xclip/xsel 进程继续提供剪贴板内容,但随 pi 一起被挂起(#11179)
- 修复了当两个 codemode 工作者都忙时(例如并行调用 codemode 或在进程内子代理),codemode 脚本立即失败的问题。脚本现在最多等待 60 秒以获取空闲工作者,且 PI_CODEMODE_MAX_WORKERS 可提高工作者数量限制至两个(#11184)
- 修复了通过扩展加载器别名和虚拟模块暴露子路径后,导入 @earendil-works/pi-ai/models(例如用于 clampThinkingLevel)时扩展无法加载的问题(#11156)
- 修复了以 UTF-8 BOM 开头的 mcp.json 文件解析失败的问题,这会导致跳过所有 MCP 服务器并使 pi mcp add/pi mcp remove 命令失败(#11191)
- 修复了 /compact 指令在摘要生成时忽略指令的问题,特别是当压缩操作将对话轮次拆分时。如果该被拆分的轮次是自上次压缩以来唯一的新内容,则指令会被完全忽略(#11058)
- 修复了恢复会话和 /tree 导航导致扩展工具处于非活动状态的问题,这种情况发生在分支记录其工具的时间早于这些工具注册的时间,例如在会话开始后安装的扩展所提供的工具。除非这些工具以 defaultActive: false 的方式注册,否则分支从未添加或移除的扩展工具现在均为活动状态(#11062, #11075)
- 修复了从输出限制截断的响应中恢复后会话中断的问题:被截断的工具调用被省略,但其工具结果被保留,导致提供商拒绝所有后续请求(#11227, #11233 by @petrroll)
- 修复了 grep 工具遵循 RIPGREP_CONFIG_PATH 的问题,其中诸如 --fixed-strings 之类的选项会静默地将正则表达式搜索更改为字面量搜索。该工具现在运行 rg --no-config(#11203, #11230 by @petrroll)
- 修复了 Windows shell 检测拒绝可运行的 Microsoft Store shell 别名的问题(#9504 by @petrroll)
- 修复了 Windows shell 检测遗漏 PATH 之外的 PowerShell 以及当 Windows 未安装在 C:\Windows 时的旧版 WSL bash.exe 启动器的问题。pi 现在检查 %ProgramFiles%\PowerShell\7、%SystemRoot%\System32\WindowsPowerShell\v1.0 和 %SystemRoot%(#9501 by @petrroll)
- 修复了 GitHub Copilot 会话在处理大型请求体(如大量图片)时失败的问题,错误表现为 HTTP 413 无法解析请求,而不是进行压缩并重试(#11016 by @petrroll)
- 修复了 openai-codex 提供程序提供 gpt-5.5 和 gpt-5.3-codex-spark 的问题,这两个模型对于 ChatGPT 账户始终会失败(#11173 by @lucasmeijer)
- 修复了仅包含空白字符的工具输出(例如来自 bash 的裸 \r\n)导致 OpenAI Completions、OpenAI Responses 和 Google 请求因 400 错误而失败的问题(#8720)
- 修复了自动重试未触发的问题,包括更多的网关上游故障、Codex CLI 代理转发的流在完成前断开连接错误、Google Vertex OAuth 令牌刷新临时失败,以及由于请求 ID 或字节计数中包含数字而导致的重试错误(#10920, #11057, #10996)
- 修复了 OpenAI Responses 模型在移除工具后,每次延迟加载工具时丢失提示缓存的问题(#10940)
- 修复了 Cloudflare Workers AI 分类器的定价问题:Clef Flash 的成本为每百万输入令牌 0.038 美元,Jev 为 0.042 美元,而不是之前列出的 Jev 免费。
- 修复了未闭合的 $$ display-math 块导致其后的每个 Markdown 表格被吞没或损坏的问题 (#11159)
- 修复了 Markdown 粗体和斜体在 CJK 标点符号旁边无法正确渲染的问题 (#10730 by @theBucky)
- 修复了 @ 文件自动补全在包含正则元字符(如 [ 或 ()的查询中不返回结果的问题 (#10972)
更进一步:量化金融体系
看懂新闻只是起点——沿量化金融路径,把它变成能交付的工程能力