desktop: app-version.v1 in drafts.sqlite is never refreshed — reports 1.19.4 while running 2.3.2

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

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
66/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
sqlite, typescript

调研方向

在桌面工作区中搜索字面量键 app-version.v1(以及 drafts.sqlite),以找到首次运行时写入状态行的位置;那个写入位置就是要修改的地方。然后查看打包构建版本在其他地方是如何读取的——issue 指向 resources/opencode-cli.version 和 exe 的 ProductVersion——并在启动时将其作为唯一可信来源,而不是持久化的值。完成意味着升级后的全新启动会使 default.dat / app-version.v1 等于正在运行的版本;通过在前后查询 state 表(在 drafts.sqlite 中)来验证。

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

描述

area/desktop platform/windows type/feature version/v2
Description

Summary

default.dat / app-version.v1 in the desktop state store is written once and never updated on upgrade, so it reports a version far behind the running app. I hit this while filing another issue: I stated "Desktop 1.19.4" while actually running 2.3.2, and triage had to correct me.

Environment

  • OpenCode Desktop 2.3.2 (OpenCode.exe → ProductVersion 2.3.2, bundled resources/opencode-cli.version = 2.3.2)
  • Windows 10 Pro
  • Store: %APPDATA%\ai.opencode.desktop\drafts.sqlite, table state

Evidence

name        = default.dat
key         = app-version.v1
value       = {"version":"1.19.4"}
updated_at  = 1792734461668  (2026-10-23 10:47:41)

Neighbouring rows in the same store are current, so this is not a stale database:

default.dat / settings.v3          updated 2026-11-24 15:56  (today)
opencode.global.dat / server       updated 2026-11-24 16:32  (today)
default.dat / app-version.v1       updated 2026-10-23 10:47

Expected

Version metadata should reflect the running build, or not be persisted at all.

Actual

Frozen at 1.19.4 across at least one upgrade to 2.3.2.

Impact

  • Bug reports and diagnostics that read this key carry a wrong version, which misroutes triage (mine was initially treated as a V1/V2 mismatch).
  • Anything gated on "version changed since last run" (release notes, update prompts, one-time migrations) can behave incorrectly if it reads the same key.

Suggested fix

Read the version from the packaged manifest at startup (or compare it with the key and rewrite it on boot); do not rely on a value written once at first run.

Plugins

No response

OpenCode version

No response

Steps to reproduce

No response

Screenshot

No response

Operating System

No response

Terminal

No response

主要语言
TypeScript
星标
228k
派生
31k
平均合并
3 小时 22 分钟
30 天内合并 PR
476

环境准备

从这里开始

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

anomalyco/opencode 的其他 Issue

查看 anomalyco/opencode 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

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