Skip to content

The agent that grows with you

fix(desktop): wire source channels and per-app relaunch state

ethernetf53bce9cff72
diff --git a/apps/desktop/electron/main.ts b/apps/desktop/electron/main.ts
index be2fdf4b0ce..913f5f1e39b 100644
--- a/apps/desktop/electron/main.ts
+++ b/apps/desktop/electron/main.ts
@@ -425,9 +425,10 @@ import { AppInstallerStrategy } from './updater/app-installer'
import {
createCheckoutStrategy
} from './updater/checkout'
+import { readSourceUpdate, type SourceUpdate } from './updater/checkout-source'
import { ExternalStrategy } from './updater/external'
import { createMacStrategy } from './updater/mac-client'
-import { consumePendingRelaunch, registerUpdateRelaunch } from './updater/relaunch'
+import { type ConsumedRelaunch, consumePendingRelaunch, registerUpdateRelaunch, type RelaunchRegistration } from './updater/relaunch'
import { startRelaunchWaiter } from './updater/relaunch-waiter'
import { createStoreStrategy } from './updater/store-client'
import { isHermesOwnedVenvDaemon } from './venv-holder-select'
@@ -3121,8 +3122,8 @@ function resolvePackagedUpdateStrategy(): UpdaterStrategy | null {
emitUpdateProgress,
appVersion: app.getVersion(),
quit: () => app.quit(),
- registerPendingRelaunch: fromVersion =>
- registerUpdateRelaunch(HERMES_HOME, fromVersion, {
+ registerPendingRelaunch: (fromVersion: string): Promise<RelaunchRegistration> =>
+ registerUpdateRelaunch(app, fromVersion, {
// The relaunch mechanism: a detached waiter, external to the dying
// process. It snapshots the OLD package, signals the handshake,
// waits for this process to exit and for the OS to swap the
@@ -3163,7 +3164,7 @@ function resolvePackagedUpdateStrategy(): UpdaterStrategy | null {
restore: restoreBundledBackend,
emitProgress: emitUpdateProgress,
quit: () => app.quit(),
- registerPendingRelaunch: fromVersion => registerUpdateRelaunch(HERMES_HOME, fromVersion, {
+ registerPendingRelaunch: (fromVersion: string): Promise<RelaunchRegistration> => registerUpdateRelaunch(app, fromVersion, {
relaunch: () => startRelaunchWaiter({
processId: process.pid,
processStartTimeMs: Math.round(Date.now() - process.uptime() * 1000),
@@ -3197,6 +3198,12 @@ function resolveCheckoutUpdateStrategy(): UpdaterStrategy {
directoryExists,
readCanonicalInstallStamp,
readDesktopUpdateConfig,
+ readSourceUpdate: (updateRoot: string): Promise<SourceUpdate> => readSourceUpdate({
+ python: findPythonForRoot(updateRoot),
+ git: resolveGitBinary(),
+ updateRoot,
+ hermesHome: HERMES_HOME
+ }),
resolveUpdateRoot,
resolveUpdaterBinary,
resolveHealedBranch,
@@ -17207,7 +17214,8 @@ async function detectRendererSkew() {
function showAboutPanelFresh(): void {
void Promise.all([detectRendererSkew(), resolveHermesVersion()]).then(([skew, version]) => {
const info: AppVersionInfo = appVersionInfo(INSTALL_STAMP, version, app.getVersion())
- const display: string = info.channel ? `${info.appVersion} (${info.channel})` : info.appVersion
+ // The product name already identifies canary and commit builds.
+ const display: string = info.appVersion
app.setAboutPanelOptions({
applicationName: APP_NAME,
applicationVersion: skew.outOfSync
@@ -17730,7 +17738,7 @@ app.whenReady().then(() => {
// an OS package swap, consume it here — the renderer toasts "Hermes
// updated to vX.Y.Z" once its bridge is up. Same-version markers (update
// never landed) are deleted silently.
- const relaunchInfo = consumePendingRelaunch(HERMES_HOME, app.getVersion())
+ const relaunchInfo: ConsumedRelaunch = consumePendingRelaunch(app, app.getVersion())
if (relaunchInfo.wasUpdateRelaunch) {
rememberLog(`[updates] post-update relaunch detected (from ${relaunchInfo.fromVersion})`)
diff --git a/website/docs/getting-started/updating.md b/website/docs/getting-started/updating.md
index 05dadc32455..f939bf21a30 100644
--- a/website/docs/getting-started/updating.md
+++ b/website/docs/getting-started/updating.md
@@ -69,7 +69,10 @@ including through `hermes update` or `hermes update --check`. They explain:
Separate applications still share Hermes profiles, configuration, and sessions
under the same Hermes home. Running different builds against one profile is not
schema isolation: newer builds can change stored data that an older build cannot
-read. Back up shared data before testing. The `hermes://` URL scheme remains
+read. Back up shared data before testing. The desktop and standalone CLI warn
+when another live installation uses the same profile; this is advisory, not a
+lock. Desktop post-update notices are scoped to the application, so launching
+canary cannot consume stable's pending notice. The `hermes://` URL scheme remains
shared; the application that most recently registered it handles links.
### Source channels and install identity
@@ -93,7 +96,9 @@ published release for that channel and update the checkout to its exact Git
commit. Canary does not mean the current tip of `main`, and an unpublished tag
is not a release. Switching a source channel does not install a desktop package.
Per-install records live under `update.installs` in configuration, so one
-checkout's choice does not change another installation's channel.
+checkout's choice does not change another installation's channel. The source-built
+desktop uses that same selection for checks and update handoffs; it does not
+replace a selected release channel with its default branch.
Packaged desktop feed channels derive from their build tag and package owner.
Changing a source channel is not an MSIX or Store channel switch. Canary builds