Skip to content

feat: record the version so it can be read without running the server - #2472

Merged
hsluoyz merged 1 commit into
the-open-agent:masterfrom
lulululu-debug:feat/version-file
Aug 3, 2026
Merged

feat: record the version so it can be read without running the server#2472
hsluoyz merged 1 commit into
the-open-agent:masterfrom
lulululu-debug:feat/version-file

Conversation

@lulululu-debug

Copy link
Copy Markdown
Contributor

What

Make the running build's version recoverable from disk without starting or querying the server. The release binaries are built with -trimpath and packed with UPX, which erases the version from the Go build metadata, so record it in a plain "version" file next to the binary instead.

Changes

  • cli.WriteVersionFile writes the version on startup (covers a binary that has been run at least once), best-effort so a failure never affects startup and only a real version is written - a plain "dev" build has nothing to record.
  • install.sh / install.ps1 write the resolved release tag at install time (covers a binary installed but not yet run). install.sh mirrors the existing sudo fallback; install.ps1 writes UTF-8 without a BOM.

The file lives next to the binary, the same directory the SQLite database uses.

Make the running build's version recoverable from disk without starting or
querying the server. The release binaries are built with -trimpath and packed
with UPX, which erases the version from the Go build metadata, so record it in
a plain "version" file next to the binary instead.

- cli.WriteVersionFile writes the version on startup (covers a binary that has
  been run at least once), best-effort so a failure never affects startup and
  only a real version is written - a plain "dev" build has nothing to record.
- install.sh / install.ps1 write the resolved release tag at install time
  (covers a binary installed but not yet run). install.sh mirrors the existing
  sudo fallback; install.ps1 writes UTF-8 without a BOM.

The file lives next to the binary, the same directory the SQLite database uses.
@hsluoyz
hsluoyz merged commit 5a3331c into the-open-agent:master Aug 3, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants