← 返回更新日志

Pi v0.50.2

2026-01-29 · GitHub 原文
### 新功能 - **Hugging Face 提供商**:通过 OpenAI 兼容的推理路由器访问 Hugging Face 模型。设置 `HF_TOKEN` 环境变量。详见 [README.md#hugging-face](README.md#hugging-face)。 - **扩展提示词缓存**:设置 `PI_CACHE_RETENTION=long` 可为 Anthropic 启用 1 小时缓存(默认 5 分钟),为 OpenAI 启用 24 小时缓存(默认内存缓存)。仅适用于直接 API 调用。详见 [README.md#prompt-caching](README.md#prompt-caching)。 - **可配置自动补全高度**:`autocompleteMaxVisible` 设置项(3-20 项,默认 5)控制下拉菜单大小。可通过 `/settings` 或 `settings.json` 进行调整。 - **类 Shell 键盘快捷键**:`alt+b`/`alt+f` 用于单词导航,`ctrl+d` 用于向前删除字符。详见 [docs/keybindings.md](docs/keybindings.md)。 - **RPC `get_commands`**:无头客户端现在可以以编程方式列出可用命令。详见 [docs/rpc.md](docs/rpc.md)。 ### 新增 - 通过 OpenAI 兼容的推理路由器添加 Hugging Face 提供商支持 ([#994](https://github.com/badlogic/pi-mono/issues/994)) - 添加 `PI_CACHE_RETENTION` 环境变量以控制 Anthropic(5 分钟 vs 1 小时)和 OpenAI(内存缓存 vs 24 小时)的缓存 TTL。设置为 `long` 以启用延长缓存。 ([#967](https://github.com/badlogic/pi-mono/issues/967)) - 添加 `autocompleteMaxVisible` 设置项以配置自动补全下拉菜单高度(3-20 项,默认 5) ([#972](https://github.com/badlogic/pi-mono/pull/972) by [@masonc15](https://github.com/masonc15)) - 添加 `/files` 命令以列出当前会话中的所有文件操作(读取、写入、编辑) - 添加类 Shell 键盘快捷键:`alt+b`/`alt+f` 用于单词导航,`ctrl+d` 用于向前删除字符(当编辑器中有文本时) ([#1043](https://github.com/badlogic/pi-mono/issues/1043) by [@jasonish](https://github.com/jasonish)) - 添加 `get_commands` RPC 方法,供无头客户端列出可用命令 ([#995](https://github.com/badlogic/pi-mono/pull/995) by [@dnouri](https://github.com/dnouri)) ### 更改 - 提升 TUI 中 `extractCursorPosition` 的性能:按逆序扫描行,当光标位于视口上方时提前退出 ([#1004](https://github.com/badlogic/pi-mono/pull/1004) by [@can1357](https://github.com/can1357)) - 自动补全改进:更好地处理部分匹配和边界情况 ([#1024](https://github.com/badlogic/pi-mono/pull/1024) by [@Perlence](https://github.com/Perlence)) ### 修复 - 现在,当 pi 重新加载或保存无关设置时,对 `settings.json` 的外部编辑将被保留。此前,直接编辑 settings.json(例如从 `packages` 数组中移除包)会在下次 pi 启动时被自动覆盖(例如当 `setLastChangelogVersion()` 等自动设置器触发保存时)。 - 修复启用 `quietStartup` 时自定义头部显示不正确的问题 ([#1039](https://github.com/badlogic/pi-mono/pull/1039) by [@tudoroancea](https://github.com/tudoroancea)) - 包过滤器中的空数组现在会禁用所有资源,而不是回退到清单默认值 ([#1044](https://github.com/badlogic/pi-mono/issues/1044)) - 自动重试计数器现在在每次成功获取 LLM 响应后重置,而不是在工具使用轮次中累积 ([#1019](https://github.com/badlogic/pi-mono/issues/1019)) - 修复警告消息中不正确的 `.md` 文件名 ([#1041](https://github.com/badlogic/pi-mono/issues/1041) by [@llimllib](https://github.com/llimllib)) - 修复终端窗口较窄时页脚中提供商名称被隐藏的问题 ([#981](https://github.com/badlogic/pi-mono/pull/981) by [@Perlence](https://github.com/Perlence)) - 修复反斜杠输入缓冲导致编辑器中字符显示延迟的问题 ([#1037](https://github.com/badlogic/pi-mono/pull/1037) by [@Perlence](https://github.com/Perlence)) - 修复 Markdown 表格渲染,添加正确的行分隔符和最小列宽 ([#997](https://github.com/badlogic/pi-mono/pull/997) by [@tmustier](https://github.com/tmustier)) - 修复 OpenAI 补全的 `toolChoice` 处理逻辑 ([#998](https://github.com/badlogic/pi-mono/pull/998) by [@williamtwomey](https://github.com/williamtwomey)) - 修复因工具调用 ID 使用竖线分隔,导致从 OpenAI Responses API 提供商切换时跨提供商交接失败的问题 ([#1022](https://github.com/badlogic/pi-mono/issues/1022)) - 修复 429 速率限制错误错误地触发自动压缩(auto-compaction)而非带退避的重试机制的问题 ([#1038](https://github.com/badlogic/pi-mono/issues/1038)) - 修复 Anthropic 提供商以正确处理 API 返回的 `sensitive` stop_reason ([#978](https://github.com/badlogic/pi-mono/issues/978)) - 通过检测 `deepseek.com` URL 并禁用不支持的 `developer` 角色,修复与 DeepSeek API 的兼容性问题 ([#1048](https://github.com/badlogic/pi-mono/issues/1048)) - 修复 Anthropic 提供商,在代理于 `message_delta` 事件中省略输入 token 计数时予以保留 ([#1045](https://github.com/badlogic/pi-mono/issues/1045)) - 修复 `autocompleteMaxVisible` 设置未持久化到 `settings.json` 的问题