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

Open Beginner friendly
#66,079 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
66/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
sqlite, typescript

Research direction

Search the desktop workspace for the literal key app-version.v1 (and drafts.sqlite) to find where the state row is written on first run; that write site is the thing to change. Then look at how the packaged build version is read elsewhere — the issue points to resources/opencode-cli.version and the exe ProductVersion — and use that as the source of truth on startup instead of the persisted value. Done means a fresh launch after an upgrade leaves default.dat / app-version.v1 equal to the running version; verify by querying the state table in drafts.sqlite before and after.

Written by the indexing model from the issue text.

Description

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

Dominant language
TypeScript
Stars
228k
Forks
31k
Avg merge
3h 22m
Merged PRs (30d)
476

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from anomalyco/opencode

All issues in anomalyco/opencode

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.