Skip to content

Keep Hermes Desktop opening on its runtime after Hermes updates - #718

Merged
spencerbull merged 3 commits into
masterfrom
hermes-desktop-runtime-launch
Sep 29, 2026
Merged

spencerbull merged 3 commits into
masterfrom
hermes-desktop-runtime-launch

Conversation

@spencerbull

@spencerbull spencerbull commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Once a Hermes runtime updates itself past the packaged release, the app icon stops opening Hermes Desktop. Upstream's _desktop_launch_options() has returned five values since 2026-09-27, with renderer accessibility appended, and the launcher unpacked exactly four, so it died with ValueError: too many values to unpack (expected 4) before exec. The desktop entry discards the launcher's stderr, so the click does nothing and leaves nothing in the logs. Both hermes update and the app's own Update now move the runtime there.

The launcher also exported HERMES_DESKTOP_IGNORE_EXISTING=1 on every launch, including for the app built inside the runtime, and current Desktop reads that as "skip the installed runtime". So the runtime's own app opened on "Set up Hermes Desktop" instead of the user's Hermes. The in-app updater relaunches the app binary directly and passes the variable on, so every in-app update came back to first-run setup, and choosing Install Hermes locally rebuilt everything before the app gave up waiting for its backend.

The launcher now reads the fifth value when there is one, and bridges an explicit renderer_accessibility: false to HERMES_DESKTOP_RENDERER_ACCESSIBILITY=0 the way hermes desktop does. It tells only the packaged /opt app to skip an existing Hermes, and leaves an explicit value in the environment alone. The runtime's own app finds its runtime through the normal installed-runtime lookup, which is how hermes desktop launches it. Pinning it with HERMES_DESKTOP_HERMES_ROOT instead would resolve ahead of the lookup that Repair install bypasses, turning a hard repair into a restart against the same venv.

runtime-test.py now runs a helper that returns five values and records both variables, so check() fails if the four-value unpack, the unconditional export or a root pin comes back.

One case is unchanged. When the runtime's app is missing and the launcher falls back to /opt, the v2026.9.7 app there still adopts a usable runtime at ~/.hermes/hermes-agent whatever HERMES_DESKTOP_IGNORE_EXISTING says, because in that release the variable only guards the hermes found on PATH. It does open against the runtime. Keeping the release app off a newer runtime would need a different mechanism, and this change does not attempt one.

One case gets worse until the runtime first updates. Until then the runtime's app is the seeded copy of the packaged release, and that release looks for a hermes on PATH after the installed runtime, skipping it only when HERMES_DESKTOP_IGNORE_EXISTING is set. Without the variable, a Repair install that escalates to a reinstall finds ~/.local/bin/hermes, which is the same runtime, and restarts it instead of rerunning the installer. Upstream's own hermes desktop launches that build the same way, and upstream main no longer looks on PATH, so the first hermes update or in-app update ends it, as will the next package release. Setting the variable for the seeded app instead would pass through the in-app updater's relaunch into the rebuilt app and bring back the setup screen this change fixes.

This carries the work of @angelundeveloped in #708 and @manuaudio in #705, which fixed this launcher from two sides. Both of their commits are kept with their authorship.

Fixes omacom/omarchy#13491
Fixes omacom/omarchy#13453

Codex XHigh reviewed the change; it can read the session that wrote it, so its independence is not guaranteed. It agreed that the runtime lookup is right, and it raised both limits described above.

🤖 Generated by Opus 5.5 in Claude Code. Reviewed by Codex XHigh.

manuaudio and others added 3 commits September 28, 2026 23:24
Hermes now returns five values from _desktop_launch_options(), appending the renderer accessibility switch. The launcher unpacked exactly four, so once a user's runtime updated, every launch died with "too many values to unpack" before the app opened. The launcher now takes the first four and reads the fifth when present, so it keeps working with the packaged release and with newer runtimes, and it bridges an explicit accessibility opt-out the same way Hermes' own launcher does. The launch check now also runs a five-value helper, which fails against the previous launcher.

Fixes omacom/omarchy#13491

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…er's new arity

_desktop_launch_options() returns five values since Hermes grew a trailing
renderer_accessibility field, so the launcher died with "too many values to
unpack (expected 4)" before os.execve — and gtk-launch discards stderr, so the
app icon became a silent no-op that left no process and no log line behind.

The launcher also exported HERMES_DESKTOP_IGNORE_EXISTING=1 unconditionally
while preferring the runtime's own app binary a few lines above it: with a
runtime installed, Desktop skipped that runtime and offered first-run setup
instead of the user's sessions. Ignoring an existing runtime is only correct for
the bundled /opt app, which is built from the package's release commit and
cannot drive a runtime built from another one.

pkgrel bumped for the changed artifact.
The runtime's own app now finds its runtime the way `hermes desktop` launches it, through the installed-runtime lookup, instead of being pinned to it with HERMES_DESKTOP_HERMES_ROOT. That variable is upstream's developer override: it resolves before the lookup that Repair install bypasses, so pinning the runtime turned a hard repair into a restart against the same broken venv. HERMES_DESKTOP_IGNORE_EXISTING is set only when the launcher falls back to the packaged /opt app, and an explicit value in the environment still wins, so the in-app updater's relaunch of the runtime app no longer inherits it.

The fifth launch option is read the way it was accepted in the previous commit but one, with the checksums the two earlier commits left stale brought up to date. runtime-test.py now records both variables, so it fails if the unconditional export or the root pin comes back.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Codex XHigh <noreply@openai.com>
@spencerbull

Copy link
Copy Markdown
Contributor Author

End-to-end review of 850550b, using the package CI built for it (its launcher is byte-identical to the branch), on three fresh dev-channel workers set up through omarchy-install-hermes-cli --now. Opus 5.5 ran the flows. Codex XHigh gave a second opinion on the diff against upstream's v2026.9.7 and main sources; it can read the reviewing session, so its independence is not guaranteed.

Both issues are fixed on a real desktop:

One regression, now described in the body: until the runtime first updates, the runtime's app is the seeded v2026.9.7 build, which looks for a hermes on PATH unless HERMES_DESKTOP_IGNORE_EXISTING is set. With the runtime's backend broken but hermes --version still answering, the fourth Repair install press logged repair requested; bypassing the usable active runtime to re-run the installer and then Starting Hermes backend via existing Hermes CLI at /home/omarchy/.local/bin/hermes: the same venv, no installer. With master's launcher on the same worker, it fell through to bootstrap and offered Install Hermes locally. Upstream's own hermes desktop behaves like this branch on that build, and upstream main no longer looks on PATH, so the first update ends it. Codex pointed out that seeding the variable back would ride the updater's relaunch into the rebuilt app and bring back #13453, so the remaining alternative is patching the packaged app's resolver at build time, which the next package release would make unnecessary.

Nothing else was found. Waiting on the maintainer to merge; #705 and #708 are superseded by this once it lands.

🤖 Generated by Opus 5.5 in Claude Code. Reviewed by Codex XHigh.

@dadofsambonzuki

Copy link
Copy Markdown

Independently reproduced on a machine that hit this today: Omarchy 4.0.4, hermes-desktop 2026.8.31-3 from the repo, Hermes runtime at main v0.21.5+4685.g12c3d5c after an in-app update at 21:25. Both halves are real here, and this PR's launcher is the one that fixes them.

Ran the packaging check with this PR's test file against master's launcher (python runtime-test.py <source> <runtime.patch> <launcher>, source = the v2026.9.7 tag extracted from the runtime checkout):

  • master launcher x this PR's runtime-test.py: ValueError: too many values to unpack (expected 4, got 5)
  • master launcher x this PR's runtime-test.py: assertion on the recorded launch env, 'a11y': None, 'ignore': '1', 'root': None — the unconditional export, caught by the new fixture
  • this PR's launcher x this PR's runtime-test.py: PASS: desktop settings, environment, native/fallback namespace sandbox and updater gate
  • master launcher x master's test: also PASS, which is how the package shipped broken — that run resolves the v2026.9.7 helper, which still returns four

The live incident, from the app's own ~/.hermes/logs/desktop.log at the moment the update finished (the hand-off script re-execs the app binary with the launcher's environment, so this is the in-app-update path described here):

[21:28:48] [bootstrap] HERMES_DESKTOP_IGNORE_EXISTING=1; skipping the installed runtime at /home/nathan-day/.hermes/hermes-agent
[21:28:48] [boot] Waiting for first-run setup choice

and the icon was a silent no-op at the same time, traceback as in the issue.

I also ran this PR's launcher bytes on the live machine (runtime checkout ahead of the package): the child environment carries no HERMES_DESKTOP_IGNORE_EXISTING and no HERMES_DESKTOP_HERMES_ROOT, and the launch reaches the app with install stamp: 12c3d5c9686b (main) from local.

Two notes, neither blocking:

@spencerbull

spencerbull commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor Author

@manuaudio @angelundeveloped thank you both. You fixed this launcher from two sides: #705 accepted the fifth launch option Hermes started returning, and #708 found that the unconditional HERMES_DESKTOP_IGNORE_EXISTING export sent every in-app update back to first-run setup. Both of your commits are in this change, and it landed in master as 5a49a3f with both of you credited as co-authors.

I'm closing #705 and #708 in favour of it: all three change the same lines, so only one of them could land.

Thanks as well to @dadofsambonzuki for reproducing both halves independently. The optional hardening of the unpack is noted for a follow-up rather than this change, so what merged is the build that was tested.

🤖 Generated by Opus 5.5 in Claude Code.

@spencerbull
spencerbull merged commit 5a49a3f into master Sep 29, 2026
6 checks passed
@spencerbull
spencerbull deleted the hermes-desktop-runtime-launch branch September 29, 2026 21:35
@github-actions

Copy link
Copy Markdown
Contributor

Publish succeeded → live

Packages: hermes-desktop (x86_64, PR artifact)

  • edge/x86_64: hermes-desktop-2026.9.7-3-x86_64

Commit 5a49a3f · run

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

Labels

None yet

Projects

None yet

3 participants