Skip to content

v1.14.34:Shell 命令增强 + 服务器认证修复

发布日期:2026年5月4日


🎯 一句话总结

改进了 Shell 命令处理,新增 PTY 连接票据和 v2 会话失败事件,修复了大量服务器认证、代理和错误提示问题。


🆕 新功能:PTY 连接票据

这次更新了什么?

新增 PTY(伪终端)连接票据(ticket)机制,让经过认证的终端 WebSocket 连接在不同客户端之间更可靠。

这有什么用?

如果你使用 Desktop 版或通过浏览器连接 OpenCode 服务器,终端连接会更稳定,不容易出现断连或认证失败的情况。


🆕 新功能:v2 会话失败事件

这次更新了什么?

v2 API 新增了会话失败事件,客户端可以检测到运行失败的任务并展示给用户。

这有什么用?

  • 使用 SDK 或 API 的开发者可以监听会话失败事件
  • 能及时感知任务出错,而不是一直等待
  • 适合做自动化的错误处理和重试逻辑

🆕 新功能:Shell 命令处理改进

这次更新了什么?

改进了对 Bash、PowerShell 和 cmd 会话的 Shell 命令处理。

这有什么用?

无论你使用哪种 Shell 环境(Linux/Mac 的 Bash、Windows 的 PowerShell 或 cmd),命令执行的行为都更一致、更可靠。


🆕 新功能:TUI debug info 命令

这次更新了什么?

TUI 新增 debug info 命令,可以打印环境信息和诊断详情。

这有什么用?

遇到问题时,运行 debug info 可以快速获取:

  • 当前环境变量
  • 运行时配置
  • 版本信息

方便排查问题或在社区提交 issue 时附上诊断信息。


🆕 新功能:Basic Auth 用户名选项

这次更新了什么?

TUI 新增 --username 选项,用于连接需要基本认证(basic auth)的服务器。

这有什么用?

如果你的 OpenCode 服务器启用了基本认证保护,现在可以在命令行指定用户名,不用在每次连接时手动输入。


🔧 问题修复

HTTP 错误不再返回空内容

问题:effect HTTP 服务器出错时,客户端收到的是空响应而不是有意义的错误信息。

修复:现在返回结构化的错误信息体。

对你有什么影响:API 调用失败时能看到具体错误原因,而不是空白的 {}


服务器认证环境变量热加载

问题:新增 HTTP 监听器时,认证相关的环境变量不会重新加载。

修复:每个新的 HTTP 监听器启动时都会重新读取认证环境变量。

对你有什么影响:修改认证配置后无需重启服务器。


Worktree 创建不再卡住

问题:创建 Worktree 时,如果引导命令(bootstrap commands)正在运行,操作会卡住。

修复:Worktree 创建不再等待引导命令完成。

对你有什么影响:创建 Worktree 更加流畅。


Azure Anthropic 模型解析修复

问题:使用 Anthropic SDK 时,Azure 上的 Anthropic 模型解析不正确。

修复:修正了模型解析逻辑。

对你有什么影响:通过 Azure 使用 Anthropic 模型时不再报错。


Web UI 代理修复

问题:Web UI 代理在加载公共资源清单和代理响应时,transfer-encoding 导致问题。

修复:剥离 transfer-encoding 并允许公共清单资源加载。


Codex Spark 模型支持

问题:使用 Codex OAuth 登录时,无法使用 Codex Spark 模型。

修复:现在允许 Codex Spark 模型与 Codex OAuth 配合使用。


真实错误信息展示

问题:CLI 和 SDK 显示的服务器错误是空白的 {},看不到具体原因。

修复:现在展示真实的错误信息。


大型 Diff 内存限制

问题:处理大型 diff 时,内存使用没有上限,可能导致内存溢出。

修复:添加了内存使用上限。

对你有什么影响:处理大型文件变更时系统更稳定。


桌面端终端重连循环修复

问题:Desktop 版在恢复失败后,终端会不断尝试重连形成死循环。

修复:恢复失败后不再无限重连。


桌面端凭据保留

问题:重新打开 Desktop 应用时,auth-token 凭据会丢失。

修复:凭据现在正确保留。

对你有什么影响:重启桌面应用后不需要重新登录。


📊 要不要升级?

情况建议
使用 Desktop 版✅ 强烈推荐
使用 HTTP API / SDK✅ 强烈推荐
使用 Azure Anthropic 模型✅ 强烈推荐
使用 Codex OAuth✅ 推荐
遇到服务器认证问题✅ 推荐
正常使用中✅ 推荐

⬆️ 升级命令

bash
opencode upgrade

📋 技术细节

点击展开完整更新列表

Core

Improvements

  • Add PTY connection tickets so authenticated terminal websockets work more reliably across clients.
  • Add v2 session failure events so clients can detect and show failed runs.
  • Improve shell command handling for Bash, PowerShell, and cmd sessions.

Bugfixes

  • Return structured error bodies from the effect HTTP server instead of empty failures.
  • Reload server auth environment variables correctly for each new HTTP listener.
  • Stop worktree creation from hanging while bootstrap commands run.
  • Fix Azure Anthropic model resolution when using the Anthropic SDK.
  • Fix the web UI proxy so public manifest assets load and proxied responses do not break on transfer-encoding. (@OpeOginni)
  • Allow Codex Spark models when signing in with Codex OAuth. (@Utkub24)
  • Fix embedded UI serving from the standalone server build.
  • Fix PTY websocket connections from Desktop when using the HttpApi server.
  • Respect custom basic auth usernames in opencode clients.
  • Prompt browsers for basic auth on protected server logins. (@OpeOginni)
  • Show real server error messages in the CLI and SDK instead of bare {}.
  • Prevent large diffs from using unbounded memory.
  • Fix v2 session API responses to encode optional fields correctly.
  • Fix pagination Link headers to use the real request host.

TUI

Improvements

  • Add debug info to print environment and diagnostic details.

Bugfixes

  • Add a --username option for basic-auth server connections. (@OpeOginni)
  • Pass server auth through internal ACP connections.
  • Show provider login errors from stderr instead of swallowing them.

Desktop

Bugfixes

  • Prevent terminal reconnect loops after recovery failures.
  • Preserve auth-token credentials when reopening the app.

Thank you to 4 community contributors:

  • @PanAchy:
    • chore(opencode): exclude .map files from CLI binary build (#25500)
  • @OpeOginni:
    • fix(httpapi): add basic auth challenge for browser login
    • fix(auth): add username option for basic auth in RunCommand (#25600)
    • fix(opencode): strip transfer-encoding in UI proxy and allow public manifest assets (#25698)
  • @Utkub24:
    • fix: allow Codex Spark with Codex OAuth (#25640)
  • @cgilly2fast:
    • chore(docs): rename firmware provider to frogbot (#25453)

← 返回更新日志