← 返回更新日志

Pi v0.49.0

2026-01-17 · GitHub 原文
### 新增 - 在 ExtensionAPI 中添加 `pi.setLabel(entryId, label)`,允许扩展为每个条目设置标签 ([#806](https://github.com/badlogic/pi-mono/issues/806)) - 导出 `keyHint`、`appKeyHint`、`editorKey`、`appKey`、`rawKeyHint`,供扩展统一格式化快捷键提示 ([#802](https://github.com/badlogic/pi-mono/pull/802) by [@dannote](https://github.com/dannote)) - 从包索引导出 `VERSION` 并更新了 custom-header 示例。 ([#798](https://github.com/badlogic/pi-mono/pull/798) by [@tallshort](https://github.com/tallshort)) - 新增 `showHardwareCursor` 设置,可在支持输入法编辑器 (IME) 定位光标的同时控制其可见性。 ([#800](https://github.com/badlogic/pi-mono/pull/800) by [@ghoulr](https://github.com/ghoulr)) - 在交互式编辑器中新增类 Emacs 的剪贴板环(kill ring)编辑功能,包含 yank 和 yank-pop 快捷键,并支持传统的 Alt+字母 处理及 Alt+D 向前删除单词功能。 ([#810](https://github.com/badlogic/pi-mono/pull/810) by [@Perlence](https://github.com/Perlence)) - 在扩展上下文中新增 `ctx.compact()` 和 `ctx.getContextUsage()`,用于以编程方式执行上下文压缩及使用量检查。 - 补充了交互模式下向前删除单词及剪贴板环快捷键的文档。 ([#810](https://github.com/badlogic/pi-mono/pull/810) by [@Perlence](https://github.com/Perlence)) ### 更改 - 更新默认系统提示词措辞,以明确 pi 框架及文档的适用范围。 - 简化 Codex 系统提示词处理逻辑,改为直接对 Codex 指令使用默认系统提示词。 ### 修复 - 修复在 ESM 上下文中因“require is not defined”错误导致 photon 模块无法加载的问题 ([#795](https://github.com/badlogic/pi-mono/pull/795) by [@dannote](https://github.com/dannote)) - 修复扩展触发压缩时压缩 UI 未显示的问题。 - 修复因出错助手消息后的孤立工具结果导致 Codex API 错误的问题。当助手消息的 `stopReason` 为 `"error"` 时,其工具调用现将被排除在待处理工具跟踪之外,从而防止为将被特定提供商转换器丢弃的调用生成合成工具结果。 ([#812](https://github.com/badlogic/pi-mono/issues/812)) - 修复 Bedrock Claude 的 `max_tokens` 处理逻辑,确保其始终超过思考预算 token 数,从而防止压缩失败。 ([#797](https://github.com/badlogic/pi-mono/pull/797) by [@pjtf93](https://github.com/pjtf93)) - 修复 Claude Code 工具名称规范化逻辑,使其与工具列表进行不区分大小写的匹配,并移除无效映射。 ### 移除 - 从 read 工具中移除了 `pi-internal://` 路径解析功能。