← 返回更新日志

Pi v0.76.0

2026-05-27 · GitHub 原文
### 新功能 - **自动化显式会话 ID** - `--session-id <id>` 允许脚本创建或恢复精确的项目本地会话。参见 [Sessions](https://github.com/earendil-works/pi/blob/v0.76.0/packages/coding-agent/docs/usage.md#sessions). - **RPC bash 输出可保留在模型上下文之外** - RPC 客户端可向 `bash` 传递 `excludeFromContext` 参数,用于指定某些命令的输出不应随下一个提示词发送。参见 [RPC mode](https://github.com/earendil-works/pi/blob/v0.76.0/packages/coding-agent/docs/rpc.md#bash). - **更可预测的提供商重试与超时机制** - Codex WebSocket/SSE 等待时间已设置上限,且 `retry.provider.maxRetries` 现在控制提供商重试次数,替代了隐藏的 SDK 默认值。参见 [Retry settings](https://github.com/earendil-works/pi/blob/v0.76.0/packages/coding-agent/docs/settings.md#retry). - **跨环境终端编辑体验优化** - Apple Terminal 的 Shift+Enter 支持、Windows/JetBrains 终端能力检测以及基于 Unicode 的单词导航功能,均提升了交互式编辑体验。参见 [Terminal setup](https://github.com/earendil-works/pi/blob/v0.76.0/packages/coding-agent/docs/terminal-setup.md) 和 [Keybindings](https://github.com/earendil-works/pi/blob/v0.76.0/packages/coding-agent/docs/keybindings.md). ### 新增 - 新增 `--session-id` 参数,允许 CLI 调用者使用精确的项目本地会话 ID,若不存在则自动创建 ([#4874](https://github.com/earendil-works/pi/issues/4874)). - 在 `bash` RPC 命令中新增 `excludeFromContext` 标志,以与内部 `executeBash` API 保持一致 ([#5039](https://github.com/earendil-works/pi/issues/5039)). ### 修复 - 修复用户消息转录渲染问题,保留用户手动输入的有序列表标记 ([#5013](https://github.com/earendil-works/pi/issues/5013)). - 修复自更新命令,使显式执行 `pi update` 时能够绕过 npm、pnpm 和 Bun 的最小发布版本限制 ([#4929](https://github.com/earendil-works/pi/issues/4929)). - 修复上下文 token 估算逻辑,使计算用户图片附件时与工具返回的图片保持一致 ([#4983](https://github.com/earendil-works/pi/issues/4983)). - 修复 `httpIdleTimeoutMs` 配置,使其适用于 OpenAI Codex Responses WebSocket 的空闲等待;新增 `websocketConnectTimeoutMs` 以限制 WebSocket 连接等待时间;并新增 10 秒的 Codex SSE 响应头超时设置 ([#4945](https://github.com/earendil-works/pi/issues/4945)). - 修复 `RpcClient`,在子进程意外退出时拒绝待处理请求并处理 stdin 管道错误 ([#4764](https://github.com/earendil-works/pi/issues/4764)). - 修复托管 npm 扩展更新逻辑,避免包管理器将 pi 主机包安装或解析为 peer dependencies ([#4907](https://github.com/earendil-works/pi/issues/4907)). - 修复 RPC 模式下原始 stdout 写入逻辑,使其能够重试瞬态背压错误,并在关闭时刷新队列中的协议输出 ([#4897](https://github.com/earendil-works/pi/issues/4897)). - 修复 OpenAI Codex Responses 缓存亲和标头,改为发送 `session-id` 而非与代理不兼容的 `session_id` ([#4967](https://github.com/earendil-works/pi/issues/4967)). - 修复 `openai-codex/gpt-5.3-codex-spark` 模型元数据,使其正确识别 128k 上下文窗口 ([#4969](https://github.com/earendil-works/pi/issues/4969)). - 修复 OpenRouter/Poolside 上下文溢出检测逻辑,正确处理 `maximum allowed input length` 错误 ([#4943](https://github.com/earendil-works/pi/issues/4943)). - 修复提供商重试控制逻辑,确保 `retry.provider.maxRetries` 生效,SDK 重试默认值设为 `0`,且配额/账单相关的 429 错误不会在 Pi 的重试机制中被重复重试 ([#4991](https://github.com/earendil-works/pi/pull/4991) by [@mitsuhiko](https://github.com/mitsuhiko)). - 修复 Apple Terminal 的 `Shift+Enter` 功能,通过检测 Terminal.app 发送普通 Return 时的本地 macOS 修饰键状态来实现。 - 修复 Windows Terminal 能力检测,启用 OSC 8 超链接,确保跨行换行的长 URL 仍可点击 ([#4923](https://github.com/earendil-works/pi/issues/4923)). - 修复 JetBrains 终端能力检测,启用真彩色显示,同时禁用不受支持的 OSC 8 超链接 ([#5037](https://github.com/earendil-works/pi/pull/5037) by [@Perlence](https://github.com/Perlence)). - 修复编辑器与输入框的单词导航/删除功能,采用 Unicode 单词边界,同时保留 ASCII 标点符号边界 ([#5022](https://github.com/earendil-works/pi/pull/5022) by [@haoqixu](https://github.com/haoqixu), [#5067](https://github.com/earendil-works/pi/pull/5067) by [@haoqixu](https://github.com/haoqixu), [#5068](https://github.com/earendil-works/pi/pull/5068) by [@haoqixu](https://github.com/haoqixu)).