← 返回更新日志

OpenCode v2.2.5

2026-10-30 · GitHub 原文
### 亮点 - **工作树与 Shell 模式快捷键**:在 macOS 上按 `⌘⌥O`,或在 Windows 和 Linux 上按 `Ctrl+Alt+O` 选择工作树;按 `⌘⌥B` 或 `Ctrl+Alt+B` 选择其基础分支。现在还可使用 `⌘⇧X` 或 `Ctrl+Shift+X` 在编辑器中切换 Shell 模式。([#60713](https://github.com/anomalyco/opencode/pull/60713)) - **从评论弹窗发送引用**:在引用弹窗中按住 `⌘` 或 `Ctrl`,可将勾选按钮变为发送按钮;也可以按 `⌘Enter` 或 `Ctrl+Enter`,仅发送该引用及评论,同时保持编辑器中的其余内容不变。([#60640](https://github.com/anomalyco/opencode/pull/60640)) - **百分比压缩缓冲区**:在 `opencode.json` 中设置 `"compaction": { "buffer": "20%" }`,可按比例预留每个模型的上下文窗口,使同一项设置同时适用于上下文窗口较小和较大的模型。仍然支持使用 Token 数量。([#60647](https://github.com/anomalyco/opencode/pull/60647)) ### 核心 #### 改进 - 除了 Token 数量外,`compaction.buffer` 现在还接受模型上下文窗口的百分比,例如 `"20%"`。([#60647](https://github.com/anomalyco/opencode/pull/60647)) - 当 `read` 因文件夹缺失而失败时,错误信息会指出该文件夹以及距离它最近的现有文件夹。([#60688](https://github.com/anomalyco/opencode/pull/60688)) - 当 `edit` 找不到 `oldString` 时,错误信息会显示文件中最接近的行,或者提示该更改已经存在。([#60689](https://github.com/anomalyco/opencode/pull/60689)) - 对名为 `bash` 的工具的调用现在会以 `shell` 方式运行,而不是直接失败,并沿用相同的权限。实际名为 `bash` 的插件工具仍具有更高优先级。([#60687](https://github.com/anomalyco/opencode/pull/60687)) #### 错误修复 - 发送超过 10 MiB 的 stdio 消息时,MCP 服务器不再断开连接,同时大消息的读取速度也显著提升。([#60694](https://github.com/anomalyco/opencode/pull/60694)) - 空闲位置在关闭其 MCP 服务器后不再立即重启这些服务器。([#60668](https://github.com/anomalyco/opencode/pull/60668)) - 当输入限制大于模型的上下文窗口时,压缩功能现在会将其提示词限制在模型的上下文窗口范围内。([#60660](https://github.com/anomalyco/opencode/pull/60660)) - LiteLLM 上下文窗口错误现在会触发压缩,而不是终止会话。([#60692](https://github.com/anomalyco/opencode/pull/60692)) - 切换模型或恢复中断的响应时,推理内容不再被转换为纯文本。此前此行为会导致某些提供商出现请求错误。([#60498](https://github.com/anomalyco/opencode/pull/60498)) ### TUI #### 错误修复 - 连接菜单不再列出 MCP 服务器,因为这些服务器会在专门的位置进行管理。([#60675](https://github.com/anomalyco/opencode/pull/60675)) ### 桌面端 #### 改进 - 新增了用于选择工作树及其基础分支的键盘快捷键,并在工具提示中显示;同时新增了用于切换 Shell 模式的快捷键。现在可选中工作树路径,以复制完整目录。([#60713](https://github.com/anomalyco/opencode/pull/60713)) - 在引用弹窗中按住 `⌘` 或 `Ctrl`,可直接发送引用及其评论。([#60640](https://github.com/anomalyco/opencode/pull/60640)) - 新增扁平化输入框样式和紧凑型输入框尺寸。([#60598](https://github.com/anomalyco/opencode/pull/60598)) #### 错误修复 - 连接菜单不再列出 MCP 服务器。([#60675](https://github.com/anomalyco/opencode/pull/60675)) - 为“最近关闭”菜单中的搜索框补上了缺失的顶部内边距。([#60652](https://github.com/anomalyco/opencode/pull/60652))