← 返回更新日志

OpenCode v2.2.4

2026-10-30 · GitHub 原文
### 亮点 - **持久化桌面终端**:桌面终端现在归属于会话,其回滚缓冲内容可在服务器重启后保留,并与 TUI 及其他窗口保持同步。重命名后的终端名称也会在重启后保留。([#60346](https://github.com/anomalyco/opencode/pull/60346)) - **发布交互式产物**:在 `opencode.json` 中启用 `"experimental": { "artifacts": true }`,即可让智能体通过内置本地提供程序或插件提供的存储来发布、更新和托管 HTML 或静态产物。([#60351](https://github.com/anomalyco/opencode/pull/60351)) - **引导式 Claude Agent 设置**:从提供商选择器中选择 **Claude Agent**,即可复制 `claude auth login`、安装 Claude Code,并在继续选择模型前验证连接。([#60603](https://github.com/anomalyco/opencode/pull/60603)) - **快速选择基础分支**:创建工作树时,可在 macOS 上使用 `⌘⌥.`,或在 Windows 和 Linux 上使用 `Ctrl+Alt+.` 打开**选择基础分支**。该命令也可在命令面板和“设置 › 快捷键”中使用。([#60579](https://github.com/anomalyco/opencode/pull/60579)) ### 核心 #### 改进 - 新增可选择启用的产物功能,包括 `artifact_create`、`artifact_read`、`artifact_update` 和 `artifact_delete`,并提供内置的本地静态文件提供程序。([#60351](https://github.com/anomalyco/opencode/pull/60351)) - 让已启用的计划任务在 `opencode serve` 下运行,并协调多个服务器进程,确保每个计划任务仅触发一次。计划任务仍需通过 `experimental.schedules` 选择启用。([#60478](https://github.com/anomalyco/opencode/pull/60478)) - 提高了 OpenCode Go 对 DeepSeek V4.1 Flash 的限制。([#60625](https://github.com/anomalyco/opencode/pull/60625)) #### 错误修复 - 允许用户、项目和远程配置覆盖 Console 提供的提供商名称、限制、变体、设置和请求头。([#60597](https://github.com/anomalyco/opencode/issues/60597)) - 避免本地 OpenCode 服务请求经过环境变量中配置的代理。([#60441](https://github.com/anomalyco/opencode/pull/60441)) - 将 Claude Code 中容易引起误解的 `/login` 指令替换为 `claude auth login`。感谢 [@Tarquinen](https://github.com/Tarquinen)。([#60592](https://github.com/anomalyco/opencode/pull/60592)) ### TUI #### 错误修复 - 在主题或无关的提示词状态发生变化时,保留插件应用的提示词光标样式。([#60599](https://github.com/anomalyco/opencode/pull/60599)) - 为编辑和补丁差异视图补充了缺失的右侧内边距。([#60614](https://github.com/anomalyco/opencode/pull/60614)) - 将垂直会话标签页的活动脉冲效果扩展至整个标签页宽度。([#60338](https://github.com/anomalyco/opencode/pull/60338)) ### 桌面端 #### 改进 - 将终端迁移到与 TUI 和其他窗口共享的持久化会话 PTY,支持恢复回滚缓冲内容、服务端重命名,并可在重启后保持状态。([#60346](https://github.com/anomalyco/opencode/pull/60346)) - 新增引导式 Claude Agent 安装、登录、连接检查,以及从**需要登录**状态中恢复的功能。([#60603](https://github.com/anomalyco/opencode/pull/60603)) - 在命令面板和快捷键中新增**选择基础分支**,快捷键为 `⌘⌥.` 或 `Ctrl+Alt+.`。([#60579](https://github.com/anomalyco/opencode/pull/60579)) - 简化了会话位置弹出框,并使较长的路径更易于阅读。([#60492](https://github.com/anomalyco/opencode/pull/60492)) #### 错误修复 - 确保终端标签页点击操作和重命名字段始终关联到预期的标签页。([#60645](https://github.com/anomalyco/opencode/pull/60645)) - 在命令面板搜索中,将匹配的命令列在会话之前。([#60616](https://github.com/anomalyco/opencode/pull/60616)) - 恢复了从已打开的操作菜单中复制用户消息的功能。([#60576](https://github.com/anomalyco/opencode/pull/60576)) - 减少了流式渲染 Markdown 时的重复工作和内存分配,尤其是在长会话中。([#60549](https://github.com/anomalyco/opencode/pull/60549)、[#60562](https://github.com/anomalyco/opencode/pull/60562)、[#60577](https://github.com/anomalyco/opencode/pull/60577)) ### SDK #### 改进 - 新增 `client.experimental.artifacts.providers`、`list`、`create`、`get`、`update`、`delete` 和 `view`。([#60351](https://github.com/anomalyco/opencode/pull/60351)) - 扩展了 `client.experimental.persistentPty.update`,使其可重命名终端或清除用户标题,并公开了 `userTitle` 以及 `persistent-pty.updated` 事件。([#60329](https://github.com/anomalyco/opencode/pull/60329)) ### 扩展 #### 改进 - 为 Effect 和 Promise 插件新增 `ctx.experimental.artifact.transform(...)`,用于注册产物提供程序、功能、提示词及默认提供程序。([#60351](https://github.com/anomalyco/opencode/pull/60351))