← 返回更新日志

Pi v0.58.0

2026-03-14 · GitHub 原文
### 新功能 - Claude Opus 4.6、Sonnet 4.6 及相关 Bedrock 模型现支持 100 万 token 上下文窗口(此前为 20 万)([#2135](https://github.com/badlogic/pi-mono/pull/2135) by [@mitsuhiko](https://github.com/mitsuhiko))。 - 扩展工具调用现默认并行执行,同时保留顺序执行的 `tool_call` 预检以支持扩展拦截。 - 为 `google-vertex` 提供商新增 `GOOGLE_CLOUD_API_KEY` 环境变量支持,作为应用默认凭证(Application Default Credentials)的替代方案 ([#1976](https://github.com/badlogic/pi-mono/pull/1976) by [@gordonhwc](https://github.com/gordonhwc))。 - 扩展可通过 `newSession()` 提供确定性会话 ID ([#2130](https://github.com/badlogic/pi-mono/pull/2130) by [@zhahaoyu](https://github.com/zhahaoyu))。 ### 新增 - 为 `google-vertex` 提供商新增 `GOOGLE_CLOUD_API_KEY` 环境变量支持,作为应用默认凭证的替代方案 ([#1976](https://github.com/badlogic/pi-mono/pull/1976) by [@gordonhwc](https://github.com/gordonhwc)) - 在 `newSession()` 中新增自定义会话 ID 支持,满足需要确定性会话路径的扩展需求 ([#2130](https://github.com/badlogic/pi-mono/pull/2130) by [@zhahaoyu](https://github.com/zhahaoyu)) ### 变更 - 扩展工具拦截机制已更改为使用 agent-core 的 `beforeToolCall` 和 `afterToolCall` 钩子,替代原有的基于包装器的拦截方式。工具调用现默认并行执行,扩展 `tool_call` 预检仍按顺序运行,最终工具结果按助手源顺序输出。 - 将 Claude Opus 4.6、Sonnet 4.6 及相关 Bedrock 模型的上下文窗口从 20 万 token 提升至 100 万 token ([#2135](https://github.com/badlogic/pi-mono/pull/2135) by [@mitsuhiko](https://github.com/mitsuhiko)) ### 修复 - 修复了多工具轮次中 `tool_call` 扩展处理器因未刷新队列事件而观察到陈旧 `sessionManager` 状态的问题。通过在每次 `tool_call` 预检前清空队列中的代理事件来解决。在并行工具模式下,这能确保当前助手工具调用消息期间的状态一致性,但不保证同一助手消息中的并列工具结果。 - 修复了基于 TUI `Input` 组件的交互式输入框在显示宽 Unicode 文本(如中日韩字符、全角字符)时按视觉列宽滚动的问题,防止了搜索和过滤输入等场景下的渲染换行溢出及 TUI 崩溃 ([#1982](https://github.com/badlogic/pi-mono/issues/1982)) - 修复了当 `extended-keys-format` 保持默认 `xterm` 时,tmux 中 `shift+tab` 及其他修改后的 Tab 键绑定失效的问题 - 修复了图像转换和缩放时未应用 EXIF 方向信息的问题,导致手机拍摄的 JPEG 和 WebP 图片显示旋转或镜像 ([#2105](https://github.com/badlogic/pi-mono/pull/2105) by [@melihmucuk](https://github.com/melihmucuk)) - 修复了默认编码代理系统提示词包含当前时间的问题,现仅包含 ISO 格式的当前日期,使提示词前缀在重载和恢复会话时保持可缓存 ([#2131](https://github.com/badlogic/pi-mono/issues/2131)) - 修复了重试正则表达式,使其能匹配提供商返回的 `server_error` 和 `internal_error` 错误类型,提升了自动重试的覆盖范围 ([#2117](https://github.com/badlogic/pi-mono/pull/2117) by [@MadKangYu](https://github.com/MadKangYu)) - 修复了示例扩展,使其支持通过 `PI_CODING_AGENT_DIR` 环境变量自定义代理目录路径 ([#2009](https://github.com/badlogic/pi-mono/pull/2009) by [@smithbm2316](https://github.com/smithbm2316)) - 修复了 OpenAI Responses API 提供商在 `function_call_output` 项中未发送工具结果图片的问题,该问题会导致工具结果中的图片数据被静默丢弃 ([#2104](https://github.com/badlogic/pi-mono/issues/2104)) - 修复了 `openai-completions` 提供商将助手内容作为结构化内容块而非纯字符串发送的问题,该问题会导致与部分 OpenAI 兼容后端交互时出错 ([#2008](https://github.com/badlogic/pi-mono/pull/2008) by [@geraldoaax](https://github.com/geraldoaax)) - 修复了 OpenAI Responses `response.failed` 处理器中的错误详情,现包含状态码、错误代码和具体消息,而非仅显示通用失败提示 ([#1956](https://github.com/badlogic/pi-mono/pull/1956) by [@drewburr](https://github.com/drewburr)) - 修复了 GitHub Copilot 设备码登录轮询逻辑,使其尊重 OAuth 降速间隔、在首次令牌轮询前等待,并在 WSL/虚拟机环境中当重复降速导致超时时提供更清晰的时钟漂移提示 - 修复了未捕获 OpenAI 兼容提供商用量统计的问题,这些提供商将用量数据返回在 `choice.usage` 而非标准的 `chunk.usage` 中(例如 Moonshot/Kimi)([#2017](https://github.com/badlogic/pi-mono/issues/2017)) - 修复了终端宽度较窄时编辑器滚动指示器渲染崩溃的问题 ([#2103](https://github.com/badlogic/pi-mono/pull/2103) by [@haoqixu](https://github.com/haoqixu)) - 修复了编辑器和输入框粘贴时制表符未转换为空格的问题 ([#2027](https://github.com/badlogic/pi-mono/pull/2027), [#1975](https://github.com/badlogic/pi-mono/pull/1975) by [@haoqixu](https://github.com/haoqixu)) - 修复了宽字符(中日韩、全角字符)恰好位于换行边界时 `wordWrapLine` 溢出的问题 ([#2082](https://github.com/badlogic/pi-mono/pull/2082) by [@haoqixu](https://github.com/haoqixu)) - 修复了粘贴标记在编辑器自动换行和光标导航中未被当作原子片段处理的问题 ([#2111](https://github.com/badlogic/pi-mono/pull/2111) by [@haoqixu](https://github.com/haoqixu))