The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
fix(desktop): never report the 0.0.0 placeholder in About
finn7639fa23760bcf5
diff --git a/apps/desktop/electron/app-version.test.ts b/apps/desktop/electron/app-version.test.tsindex 2a2d9577175..ee0c0a49177 100644--- a/apps/desktop/electron/app-version.test.ts+++ b/apps/desktop/electron/app-version.test.ts@@ -1,6 +1,6 @@import { describe, expect, it } from 'vitest'-import { appVersionInfo, assertSourceUpdateChannel } from './app-version'+import { appVersionInfo, assertSourceUpdateChannel, nativeAboutVersion } from './app-version'import type { InstallStamp } from './install-stamp'describe('artifact version identity', (): void => {@@ -82,4 +82,44 @@ describe('artifact version identity', (): void => {expect(appVersionInfo(null, '9.9.9-runtime', '1.2.3')).toMatchObject({ appVersion: '9.9.9-runtime' })expect((): void => assertSourceUpdateChannel(null)).not.toThrow()})++ // #124581: the desktop package.json carries a 0.0.0 placeholder, so the+ // About panel must never repeat it as the running version.+ it('skips the 0.0.0 package placeholder for builds without a baked display version', (): void => {+ const stamp: InstallStamp = {+ payload: 'bundled',+ tag: null,+ displayVersion: null,+ baseVersion: '1.2.3',+ source: 'local',+ updateMechanism: 'external'+ } as InstallStamp++ expect(appVersionInfo(stamp, '', '0.0.0').appVersion).toBe('1.2.3')+ })++ it('keeps an offline source install unknown instead of reporting 0.0.0', (): void => {+ const stamp: InstallStamp = {+ payload: 'bootstrap',+ tag: null,+ displayVersion: null,+ baseVersion: null,+ commit: 'a'.repeat(40),+ branch: 'main',+ dirty: false,+ source: 'local',+ updateMechanism: 'self'+ } as InstallStamp++ const info = appVersionInfo(stamp, '', '0.0.0')+ expect(info.appVersion).not.toBe('0.0.0')+ // The native panel cannot render empty; it gets a truthful label.+ expect(nativeAboutVersion(info)).toBe(`git.${'a'.repeat(7)}`)+ })++ it('maps an unresolvable native About version to unknown, never empty', (): void => {+ expect(nativeAboutVersion({ appVersion: '9.9.9' })).toBe('9.9.9')+ expect(nativeAboutVersion({ appVersion: '0.0.0', baseVersion: '1.2.3' })).toBe('1.2.3')+ expect(nativeAboutVersion({ appVersion: '' })).toBe('unknown')+ })})diff --git a/apps/desktop/electron/app-version.ts b/apps/desktop/electron/app-version.tsindex 69333f54fe8..8c6ce6e51cd 100644--- a/apps/desktop/electron/app-version.ts+++ b/apps/desktop/electron/app-version.ts@@ -38,6 +38,44 @@ export function packagedReleaseChannel(stamp: Readonly<InstallStamp> | null): streturn isCanaryTag(stamp.tag) ? 'canary' : 'stable'}+/** Values that mean "no version known" rather than a real release: the empty+ * backend reply, the backend's own unknown marker, and the 0.0.0 placeholder+ * both package.json files carry on main (real releases are date-based, and+ * channel builds override the version at pack time). Repeating any of these+ * in About is how the panel ends up reporting Version 0.0.0 (#124581). */+const PLACEHOLDER_VERSIONS = new Set(['', '0.0.0', 'v0.0.0', 'unknown'])++function firstRealVersion(candidates: Array<string | null | undefined>): string {+ for (const candidate of candidates) {+ if (candidate && !PLACEHOLDER_VERSIONS.has(candidate)) {+ return candidate+ }+ }++ return ''+}++/** Map version info to the native About panel string. Unlike the renderer —+ * which renders '' as its localized "unavailable" copy — an empty+ * applicationVersion falls back to the bundle version (the 0.0.0 placeholder+ * on local builds), so unknown must become an explicit label. Commit+ * spelling matches the backend's untagged-checkout display_version+ * (`git.<short>[.dirty]`).+ * ponytail: English-only fallback; localize if the native panel ever needs it. */+export function nativeAboutVersion(info: AppVersionInfo): string {+ const version = firstRealVersion([info.appVersion, info.baseVersion])++ if (version) {+ return version+ }++ if (info.commit && !/^0+$/.test(info.commit)) {+ return `git.${info.commit.slice(0, 7)}${info.dirty ? '.dirty' : ''}`+ }++ return 'unknown'+}+/** The backend may live on another machine and run a different release. */export function appVersionInfo(stamp: Readonly<InstallStamp> | null,@@ -45,7 +83,7 @@ export function appVersionInfo(packageVersion: string): AppVersionInfo {if (!stamp) {- return { appVersion: runtimeVersion, baseVersion: packageVersion }+ return { appVersion: firstRealVersion([runtimeVersion, packageVersion]), baseVersion: packageVersion }}const build = stamp.channelBuild@@ -54,8 +92,8 @@ export function appVersionInfo(appVersion: build? `${build.sourceVersion} (${build.channel} #${build.sequence}, ${build.commit.slice(0, 8)})`: stamp.payload === 'bootstrap'- ? runtimeVersion- : stamp.displayVersion || packageVersion,+ ? firstRealVersion([runtimeVersion, stamp.displayVersion, stamp.baseVersion, packageVersion])+ : firstRealVersion([stamp.displayVersion, stamp.baseVersion, packageVersion, runtimeVersion]),baseVersion: build?.sourceVersion ?? stamp.baseVersion ?? undefined,sequence: build?.sequence,buildId: build?.buildId,diff --git a/apps/desktop/electron/main.ts b/apps/desktop/electron/main.tsindex 6f3c916e5c9..10c0f339e91 100644--- a/apps/desktop/electron/main.ts+++ b/apps/desktop/electron/main.ts@@ -46,7 +46,7 @@ import {} from './api-transport'import { appIconCandidates, resolveAppIcon, shouldOverrideDockIcon } from './app-icon'import { stageAppInstallerFile } from './app-installer-file'-import { appVersionInfo, type AppVersionInfo, assertSourceUpdateChannel, packagedReleaseChannel } from './app-version'+import { appVersionInfo, type AppVersionInfo, assertSourceUpdateChannel, nativeAboutVersion, packagedReleaseChannel } from './app-version'import { runAppInstallerChecker } from './appinstaller-checker'import { installApplicationMenuAfterFirstWindow } from './application-menu-startup'import { stopBackendChild as stopBackendChildImpl, waitForBackendExit } from './backend-child'@@ -1495,10 +1495,15 @@ if (IS_WINDOWS) {app.setAppUserModelId(IDENTITY_APP_NAME ? PRODUCT_IDENTITY.appId : 'com.nousresearch.hermes')}-// The gateway version is unknown until the backend connects.+// Seed the native About panel with the best-known Hermes version. This is+// refreshed on every open via showAboutPanelFresh, so an in-place+// `hermes update` mid-session is reflected without an app restart; the seed+// covers the first open and any non-menu invocation path. Never seed empty:+// an empty applicationVersion falls back to the bundle version, which is the+// 0.0.0 placeholder on local builds (#124581).app.setAboutPanelOptions({applicationName: APP_NAME,- applicationVersion: '',+ applicationVersion: nativeAboutVersion(appVersionInfo(INSTALL_STAMP, '', app.getVersion())),copyright: 'Copyright © 2026 Nous Research'})@@ -18194,8 +18199,9 @@ async function detectRendererSkew() {function showAboutPanelFresh(): void {void Promise.all([detectRendererSkew(), resolveHermesVersion()]).then(([skew, version]) => {const info: AppVersionInfo = appVersionInfo(INSTALL_STAMP, version, app.getVersion())- // The product name already identifies canary and commit builds.- const display: string = info.appVersion+ // The product name already identifies canary and commit builds. Never pass+ // through empty/placeholder: the panel would render the bundle's 0.0.0 (#124581).+ const display: string = nativeAboutVersion(info)app.setAboutPanelOptions({applicationName: APP_NAME,applicationVersion: skew.outOfSync ? `${display} — app build out of date, update the desktop app` : display,