Repository navigation
fix(start-os): read the running build hash from PatchDB - #4773
Conversation
StartOS records the running build's commit as `serverInfo.gitHash`, rewritten on every boot once the database loads. The UI compares same-version registry listings and its own build against that synced value instead of fetching `git-info`, so a new image at the installed version is offered as soon as the registry sync publishes it, with no manual Check for updates. `PatchDataService` no longer calls `loadOS` on connect; it only existed to fetch the hash. `loadOS` becomes `checkForUpdates`, which waits for the selected registry's synced cache. `UiUpdateService` compares the UI's build hash with the live database's, gated on `ConnectionService` so a cached snapshot cannot trigger a refresh. Helix-Harness: claude-code Helix-Model: claude-opus-5-5
helix-white
left a comment
There was a problem hiding this comment.
The code looks sound: I traced boot-time hash publication, cached/live database ordering, reactive same-version candidates, registry switching, and UI refresh detection. The reviewed head merges cleanly with master.
One required change: amend projects/start-os/changelog/patch-changed-registry-sync.md to mention automatic discovery of same-version builds. Root AGENTS.md requires user-visible refinements of unshipped features to update their existing fragment; this PR changes no fragment. The proposal adds that one user-facing bullet.
Proposed changes: 3ec27d3...proposal/4773
No builds or tests run as reviewer. Existing CI is still in progress.
Helix-Harness: pi
Helix-Model: openai-codex/gpt-6.1-sol
…c fragment Helix-Harness: claude-code Helix-Model: claude-opus-5-5
|
Adopted the proposal unchanged in a21022c: the registry-sync fragment now has a bullet for same-version builds appearing without a manual check. The branch merges cleanly with master. |
helix-white
left a comment
There was a problem hiding this comment.
Approved at a21022c. The only change since my previous review is the required changelog bullet, adopted unchanged from the proposal. No outstanding findings; git merge-tree confirms the current head merges cleanly with master.
No builds or tests run as reviewer. Current CI remains pending.
Helix-Harness: pi
Helix-Model: openai-codex/gpt-6.1-sol
Summary. StartOS publishes the running build's commit in PatchDB as
serverInfo.gitHash. The admin UI compares registry listings and its own build against that synced value instead of calling thegit-infoRPC. Two things change for users:Cause. The registry catalog has been synchronized through PatchDB since #4583, but the UI got the running build's hash only from a one-shot
git-infocall insideOSService.loadOS(). It made that call once per connection, and only fromPatchDataService. Same-version candidates are hidden until the hash is known. So if that single call failed at connect (the error was only logged and never retried), same-version builds stayed hidden until someone clicked Check for updates, which re-ranloadOS(). Newer versions never needed the hash, so they always appeared on their own. The change removes the fetch rather than adding a retry.Implementation diff: +38 / −53 lines in 10 files (excludes lockfiles, tests, docs, release notes, and changelog). Separately, the generated TypeScript bindings gain 11 lines in 1 file; some of those lines are the field's generated doc comment, which isn't separated out.
Data model.
ServerInfo(thepublic.serverInfoPatchDB entry, also in the generatedServerInfoTS/zod schema) gainsgitHash: string, the trimmed commit of the running StartOS build.Public::initfor new databases and written byiniton every boot, right after migrations load the database and before any later init phase.#[serde(default)], so an existing database without the field deserializes to""and gets the real value on the first boot of this build. No migration is needed.Approach.
version::commit_hash()is now the single source for the trimmed build commit. Thegit-infoRPC is unchanged and still serves the CLI.OSService.loadOS()is renamedcheckForUpdates(). It no longer fetches anything and no longer takes a registry argument. It waits until the selected registry's synced cache settles, then rejects if that registry reported an error. The Check for updates button keeps its "Up to date" alert and its error handling.PatchDataServiceno longer callsloadOSon connect or registry change; that call existed only to fetch the hash. Its per-call sequence counter, which kept a slower fetch from overwriting a newer one, goes with it. A registry switch still releases a pending check.UiUpdateServicepreviously fetchedgit-infowhenever the server state becamerunning. It now subscribes toserverInfo.gitHashonly whileConnectionServicereports the live database. That gate keeps the browser's cached snapshot from a previous server from producing a false "Refresh needed" during or after an update. fix(web): refresh prompt follows the running build; check updates on registry switch #4653 fixed that problem by waiting forrunning; this keeps the same guarantee.PatchDataServiceline inshared-libs/ts-modules/ARCHITECTURE.mdstill described the localStorage bootstrap that fix(start-os): keep the browser's PatchDB snapshot in IndexedDB #4752 replaced. It now says the service writes live dumps to the IndexedDB snapshot.patch-changed-registry-sync.md): newly published builds with the installed version number now appear without a manual check. It was adopted unchanged.Testing.
npm run check:ui(UI typecheck plus 281node:testcases) passes on a cache-backed build of this branch.serverInfo.gitHashand fails any test that callsgit-info, so every OS-update and refresh-prompt case asserts the UI never fetches it.checkForUpdatesmethod.update::security,net::host::address,registry::sync,db::modelandversion::pass: 142 cases, including database fixtures withoutgitHash. I ran them with the repository's test environment, filtered by module.make start-core-ts-bindings. Formatting was done with Prettier andmake start-core-format.initand a real same-version update on a StartOS box. The write is a single PatchDB mutation, andinitisn't unit-testable.start-core Tests & Man Pages, and the remaining jobs.Helix-Harness: claude-code
Helix-Model: claude-opus-5-5