Desktop shows "OpenCode 1" for incompatible SSH servers even when remote is V2

未关闭 适合新手
#62,582 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
78/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
typescript
领域
frontend

调研方向

阅读 packages/app/src/runtime/server/health-machine.ts,追踪健康状态不兼容时如何保留探测到的版本。然后检查 packages/app/src/home/projects/view.tsx 和 packages/app/src/session/server-unavailable-panel.tsx 中的回退逻辑,以及相关测试。完成标准是:V2 或未知版本不会被标记为 OpenCode 1,而已知的不兼容版本会被准确显示。

由索引模型根据 Issue 内容生成。

描述

pending close triaging
Summary

When an SSH remote is marked incompatible, Desktop always shows:

This server is running OpenCode 1, which isn't compatible with this app. Upgrade it to OpenCode V2 to continue.

even if the remote is actually running OpenCode V2 (e.g. background service 2.2.5).

Screenshot

SSH remote "deba" tooltip says OpenCode 1

Environment
  • Client: OpenCode Desktop 2.2.6 on Linux
  • Remote over SSH running OpenCode background service 2.2.5 (opencode-cli serve --service; ~/.local/state/opencode/service.json reports "version":"2.2.5")
  • CLI on the remote PATH is also V2 (opencode v2.2.5)
  • SSH auth succeeds; failure is the post-connect incompatible UI
Expected
  • Do not claim the remote is OpenCode 1 when the version is unknown or is a V2 build
  • If the remote is V2 at the wrong patch version, prefer the exact-version / "Server update required" path
  • If truly incompatible, show the actual probed version when known
Actual

Tooltip says the server is running OpenCode 1 and asks to upgrade to V2.

Suspected cause

selectServerVersion only returns a version for healthy health. For incompatible it returns undefined, and the UI falls back to "1":

// packages/app/src/runtime/server/health-machine.ts
export function selectServerVersion(health: ServerHealth | undefined) {
  return health?.type === "healthy" ? health.version : undefined
}

// packages/app/src/home/projects/view.tsx
props.language.t("server.row.incompatible", {
  version: selectServerVersion(props.health) ?? "1",
})

Same fallback in packages/app/src/session/server-unavailable-panel.tsx.

Notes

Updating the remote from 2.2.5 → 2.2.6 restores connectivity in this setup, but the OpenCode 1 label is still incorrect and misleading.

主要语言
TypeScript
星标
224k
派生
30k
平均合并
4 小时 44 分钟
30 天内合并 PR
513

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

anomalyco/opencode 的其他 Issue

查看 anomalyco/opencode 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。