← 返回更新日志

Pi v0.32.0

2026-01-03 · GitHub 原文
### 破坏性变更 - **队列 API 被 steer/followUp 取代**:`queueMessage()` 方法已拆分为两个具有不同交付语义的方法 ([#403](https://github.com/badlogic/pi-mono/issues/403)): - `steer(text)`:中断正在运行的代理(流式传输时按 Enter)。在当前工具执行完成后交付。 - `followUp(text)`:等待代理完成(流式传输时按 Alt+Enter)。仅在代理停止时交付。 - **设置项重命名**:`queueMode` 设置项已重命名为 `steeringMode`。新增 `followUpMode` 设置项。旧的 settings.json 文件将自动迁移。 - **AgentSession 方法重命名**: - `queueMessage()` → `steer()` 和 `followUp()` - `queueMode` getter → `steeringMode` 和 `followUpMode` getter - `setQueueMode()` → `setSteeringMode()` 和 `setFollowUpMode()` - `queuedMessageCount` → `pendingMessageCount` - `getQueuedMessages()` → `getSteeringMessages()` 和 `getFollowUpMessages()` - `clearQueue()` 现返回 `{ steering: string[], followUp: string[] }` - `hasQueuedMessages()` → `hasPendingMessages()` - **Hook API 签名变更**:`pi.sendMessage()` 的第二个参数从 `triggerTurn?: boolean` 更改为 `options?: { triggerTurn?, deliverAs? }`。如需跟进交付,请使用 `deliverAs: "followUp"`。此变更同时影响 hooks 和内部 `sendHookMessage()` 方法。 - **RPC API 变更**: - `queue_message` 命令 → `steer` 和 `follow_up` 命令 - `set_queue_mode` 命令 → `set_steering_mode` 和 `set_follow_up_mode` 命令 - `RpcSessionState.queueMode` → `steeringMode` 和 `followUpMode` - **设置 UI**:“Queue mode”设置项拆分为“Steering mode”和“Follow-up mode” ### 新增功能 - 可配置的双 Escape 操作:选择双 Escape(空编辑器)是打开 `/tree`(默认)还是 `/branch`。可通过 `/settings` 或 settings.json 中的 `doubleEscapeAction` 进行配置 ([#404](https://github.com/badlogic/pi-mono/issues/404)) - Vertex AI 提供商 (`google-vertex`):通过 Google Cloud Vertex AI 使用应用默认凭据访问 Gemini 模型 ([#300](https://github.com/badlogic/pi-mono/pull/300),由 [@default-anton](https://github.com/default-anton) 贡献) - models.json 中的内置提供商覆盖:仅覆盖 `baseUrl` 可通过代理路由内置提供商,同时保留其所有模型;或定义 `models` 以完全替换该提供商 ([#406](https://github.com/badlogic/pi-mono/pull/406),由 [@yevhen](https://github.com/yevhen) 贡献) - 图片自动调整大小:大于 2000x2000 的图片会自动调整大小以提升模型兼容性。原始尺寸会注入到提示词中。可通过 `/settings` 或 settings.json 中的 `images.autoResize` 控制。 ([#402](https://github.com/badlogic/pi-mono/pull/402),由 [@mitsuhiko](https://github.com/mitsuhiko) 贡献) - 流式传输期间按 Alt+Enter 可将跟进消息加入队列 - 导出 `Theme` 和 `ThemeColor` 类型,供使用 `ctx.ui.custom()` 的 hooks 使用 - 终端窗口标题现显示 "pi - dirname",以便识别当前所在的哪个项目会话 ([#407](https://github.com/badlogic/pi-mono/pull/407),由 [@kaofelix](https://github.com/kaofelix) 贡献) ### 变更 - 编辑器组件现使用单词换行而非字符级换行,以提升可读性 ([#382](https://github.com/badlogic/pi-mono/pull/382),由 [@nickseelert](https://github.com/nickseelert) 贡献) ### 修复 - `/model` 选择器现可立即打开,而无需等待 OAuth 令牌刷新。令牌刷新将延迟至实际使用模型时进行。 - Shift+Space、Shift+Backspace 和 Shift+Delete 现在在 Kitty 协议终端(如 Kitty、WezTerm 等)中可正常工作,而不会被静默忽略 ([#411](https://github.com/badlogic/pi-mono/pull/411),由 [@nathyong](https://github.com/nathyong) 贡献) - 当代理已在流式传输时调用 `AgentSession.prompt()` 将抛出异常,以防止竞态条件。流式传输期间请使用 `steer()` 或 `followUp()` 来排队消息。 - Ctrl+C 现在在选择器组件中的行为类似于 Escape,因此连续按 Ctrl+C 最终将关闭程序 ([#400](https://github.com/badlogic/pi-mono/pull/400),由 [@mitsuhiko](https://github.com/mitsuhiko) 贡献)