Skip to content

fix(app): inject OPENCODE_VERSION into web UI bundle at build time#30591

Open
ulises-jeremias wants to merge 6 commits into
anomalyco:devfrom
ulises-jeremias:fix/24286-web-ui-version-mismatch
Open

fix(app): inject OPENCODE_VERSION into web UI bundle at build time#30591
ulises-jeremias wants to merge 6 commits into
anomalyco:devfrom
ulises-jeremias:fix/24286-web-ui-version-mismatch

Conversation

@ulises-jeremias

Copy link
Copy Markdown
Contributor

Issue for this PR

Closes #24286

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

After upgrading OpenCode via CLI, the web UI served by opencode web shows a stale/older version while the CLI binary reports the correct version. This happens because the web UI bundle embeds package.json's version at build time, which lags behind when OPENCODE_VERSION is injected differently into the CLI binary.

This fix:

  • Reads OPENCODE_VERSION from the environment at app bundle build time (matching how OPENCODE_CHANNEL is already handled)
  • Injects it as VITE_OPENCODE_VERSION via Vite's define option
  • Falls back to package.json version when the env var is not set (e.g. local dev)

How did you verify your code works?

  • bun run --cwd packages/app typecheck
  • bun run --cwd packages/app test:unit
  • For manual verification: build with a known version via OPENCODE_VERSION=1.14.24 bun run --cwd packages/app build and confirm the version string appears in the JS bundle.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@ulises-jeremias ulises-jeremias force-pushed the fix/24286-web-ui-version-mismatch branch from 92eaec7 to 6d9efab Compare June 3, 2026 15:55
@thdxr thdxr requested review from Brendonovich and Hona as code owners June 11, 2026 00:17
* upstream/dev: (715 commits)
  chore: update nix node_modules hashes
  feat(oauth): unify OAuth callback browser pages (anomalyco#34025)
  chore: generate
  refactor(app): replace tab drag handling with dndkit (anomalyco#33880)
  refactor(app): use dropdown for project selector (anomalyco#33984)
  chore: update nix node_modules hashes
  fix(app): bump ghostty-web to prevent terminal resize hangs (anomalyco#34020)
  chore: generate
  feat(sdk): expose active sessions (anomalyco#33991)
  fix(sdk): wake embedded session execution (anomalyco#33992)
  refactor(opencode): stop legacy v2 event emission (anomalyco#33993)
  fix(ui): normalize tooltip trigger layout (anomalyco#33979)
  fix(app): suspend hidden terminal renderer (anomalyco#33990)
  fix(app): enable auto-accept in session settings (anomalyco#33974)
  tweak: hide MCP access token prefix (anomalyco#33711)
  fix(core): refine small model defaults (anomalyco#33926)
  feat(core): split MCP timeout configuration (anomalyco#33977)
  fix(app): simplify question prompt (anomalyco#33968)
  feat(llm): pass strict through tool definitions for Codex parity (anomalyco#33392)
  chore: generate
  ...
@ulises-jeremias

Copy link
Copy Markdown
Contributor Author

@adamdotdevin @Hona @Brendonovich

Rebased onto latest dev (merge commit pushed). CI should re-run shortly — would appreciate a review when you have a moment. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Web UI shows lower version than CLI after update

1 participant