← 返回更新日志

Pi v1.0.4

2026-10-05 · GitHub 原文
### 新功能 - **工具模式与 `--no-mcp`**:`--tools` 和 `--exclude-tools` 现在支持 `*` 通配模式。例如,`--tools read,codemode,'mcp__radius__*'` 只保留某个 MCP 服务器的工具。除非某一项以 `mcp__` 开头,否则 `--tools` 现在会保留 MCP 工具;`--no-mcp` 则可在单次运行中关闭 MCP。请参阅[工具](https://github.com/earendil-works/pi/blob/v1.0.4/packages/coding-agent/docs/cli.md#tools)和 [MCP 工具](https://github.com/earendil-works/pi/blob/v1.0.4/packages/coding-agent/docs/cli.md#mcp-tools)。 - **Codemode 可保留图像**:对图像文件调用 `tools.read()` 现在会返回一个可由 `image()` 显示的图像块。请参阅[调用工具](https://github.com/earendil-works/pi/blob/v1.0.4/packages/coding-agent/docs/codemode.md#call-tools)。 ### 新增 - 为 `--tools` 和 `--exclude-tools` 添加了 `*` 通配模式支持,例如 `--tools read,codemode,'mcp__radius__*'` - 添加了 `--no-mcp`,用于在单次运行中禁用内置 MCP 支持 ### 修复 - 修复了围栏代码块中多行字符串和注释在第一行之后丢失语法高亮颜色的问题([#10143](https://github.com/earendil-works/pi/issues/10143)) - 修复了 codemode 脚本无法从 `read` 接收图像的问题:对于图像文件,`tools.read()` 现在会解析为可由 `image()` 显示的图像块([#10251](https://github.com/earendil-works/pi/issues/10251)) - 修复了在使用 OpenID Connect 客户端注册的服务器(例如 `mcp.modem.dev`)上,MCP OAuth 登录因 `invalid_redirect_uri` 而失败的问题:pi 现在会注册为原生客户端([#10493](https://github.com/earendil-works/pi/issues/10493)) - 修复了 `--tools` 会移除 MCP 工具,导致 `pi --tools codemode` 无法使用任何 MCP 服务器的问题。除非某一项以 `mcp__` 开头,否则 `--tools` 现在会保留 MCP 工具 - 修复了 MCP 会话关闭时服务器仍在连接,导致其传输连接在服务器响应或超时前一直保持打开的问题([#10249](https://github.com/earendil-works/pi/issues/10249)) - 修复了系统提示词规则和技能提示中会提及被 `prepareLoadout` 隐藏的工具的问题。规则中现在会排除隐藏工具;当文件读取器被隐藏时,技能提示不会提及任何工具;`codemode` 会随每个工具的声明显示其提示准则;`ToolLoadout` 新增 `getPromptGuidelines()`([#10343](https://github.com/earendil-works/pi/issues/10343)) - 修复了 Bedrock 请求在 HTTP/2 连接停滞后因 `The pending stream has been canceled` 而失败时不会自动重试的问题([#10379](https://github.com/earendil-works/pi/issues/10379)) - 修复了 codemode 脚本修改内置对象(例如 `Array.prototype.toJSON = ...`)时会导致 pi 崩溃,并使工具调用处于未完成状态的问题。现在会在脚本运行前冻结内置对象,因此此类修改不会生效([#10444](https://github.com/earendil-works/pi/issues/10444))