← 返回更新日志

Pi v0.38.0

2026-01-08 · GitHub 原文
### 破坏性变更 - `ctx.ui.custom()` 工厂函数签名从 `(tui, theme, done)` 更改为 `(tui, theme, keybindings, done)`,以便在自定义组件中访问键位绑定 - `LoadedExtension` 类型重命名为 `Extension` - 移除 `LoadExtensionsResult.setUIContext()`,替换为 `runtime: ExtensionRuntime` - `ExtensionRunner` 构造函数现在将 `runtime: ExtensionRuntime` 作为第二个参数 - `ExtensionRunner.initialize()` 签名从选项对象更改为位置参数 `(actions, contextActions, commandContextActions?, uiContext?)` - `ExtensionRunner.getHasUI()` 重命名为 `hasUI()` - 移除 OpenAI Codex 模型别名(`gpt-5`、`gpt-5-mini`、`gpt-5-nano`、`codex-mini-latest`)。请使用标准 ID:`gpt-5.1`、`gpt-5.1-codex-mini`、`gpt-5.2`、`gpt-5.2-codex`。([#536](https://github.com/badlogic/pi-mono/pull/536) by [@ghoulr](https://github.com/ghoulr)) ### 新增功能 - 新增 `--no-extensions` 标志以禁用扩展发现,但仍允许使用显式的 `-e` 路径 ([#524](https://github.com/badlogic/pi-mono/pull/524) by [@cv](https://github.com/cv)) - SDK:导出 `InteractiveMode`、`runPrintMode()`、`runRpcMode()` 用于构建自定义运行模式。详见 `docs/sdk.md`。 - 新增 `PI_SKIP_VERSION_CHECK` 环境变量以在启动时禁用新版本通知 ([#549](https://github.com/badlogic/pi-mono/pull/549) by [@aos](https://github.com/aos)) - 新增 `thinkingBudgets` 设置,用于为基于令牌的提供商自定义各思考级别的令牌预算 ([#529](https://github.com/badlogic/pi-mono/pull/529) by [@melihmucuk](https://github.com/melihmucuk)) - 扩展 UI 对话框(`ctx.ui.select()`、`ctx.ui.confirm()`、`ctx.ui.input()`)现在支持 `timeout` 选项,并带有实时倒计时显示 ([#522](https://github.com/badlogic/pi-mono/pull/522) by [@nicobailon](https://github.com/nicobailon)) - 扩展现在可以通过 `ctx.ui.setEditorComponent()` 提供自定义编辑器组件。参见 `examples/extensions/modal-editor.ts` 和 `docs/tui.md` 中的模式 7。 - 扩展工厂函数现在支持异步,从而启用动态导入和延迟加载依赖 ([#513](https://github.com/badlogic/pi-mono/pull/513) by [@austinm911](https://github.com/austinm911)) - 扩展上下文中现提供 `ctx.shutdown()` 用于请求优雅关闭。在交互模式下,关闭将推迟至代理变为空闲状态(处理完所有排队的引导和后续消息)后执行。在 RPC 模式下,关闭将推迟至完成当前命令响应后执行。在打印模式下,关闭操作为无操作(no-op),因为提示完成后进程会自动退出。([#542](https://github.com/badlogic/pi-mono/pull/542) by [@kaofelix](https://github.com/kaofelix)) ### 修复 - 修复了当配置 `enabledModels` 时,设置中的默认思考级别现在能正确应用 ([#540](https://github.com/badlogic/pi-mono/pull/540) by [@ferologics](https://github.com/ferologics)) - 修复了 pi 运行时对 `settings.json` 的外部编辑在 pi 保存设置时得以保留的问题 ([#527](https://github.com/badlogic/pi-mono/pull/527) by [@ferologics](https://github.com/ferologics)) - 修复了基于溢出的压缩逻辑:如果错误来自其他模型或已由之前的压缩处理,则跳过压缩 ([#535](https://github.com/badlogic/pi-mono/pull/535) by [@mitsuhiko](https://github.com/mitsuhiko)) - 将 OpenAI Codex 上下文窗口从 40 万令牌缩减至 27.2 万令牌,以匹配 Codex CLI 默认值并防止 400 错误 ([#536](https://github.com/badlogic/pi-mono/pull/536) by [@ghoulr](https://github.com/ghoulr)) - 上下文溢出检测现在可识别 `context_length_exceeded` 错误。 - 修复了通过 SSH 批量输入时按键丢失的问题 ([#538](https://github.com/badlogic/pi-mono/issues/538)) - 剪贴板图片支持现可在 Alpine Linux 及其他 musl 发行版上正常工作 ([#533](https://github.com/badlogic/pi-mono/issues/533))