Skip to content

Add hermes-desktop - #166

Merged
dhh merged 10 commits into
masterfrom
hermes-agent
Aug 25, 2026
Merged

dhh merged 10 commits into
masterfrom
hermes-agent

Conversation

@omarchybot

@omarchybot omarchybot commented Aug 19, 2026 •

Copy link
Copy Markdown
Collaborator

Adds hermes-desktop — Hermes as a desktop app.

Nous builds it for macOS and Windows only: their download page offers a .dmg and an .exe and points Linux users at a terminal install, so there is no vendor artifact to repackage. Their electron-builder config does carry a Linux target they never ship, and it builds clean — npm ci at the workspace root, npm run pack in apps/desktop, with node-pty and get-windows staged for linux-x64 on its own. Electron 40.10.2, 337 MB unpacked, 129 MB packaged.

The app owns its Hermes runtime

Hermes Desktop is a shell around a Hermes runtime, and it only runs against one built from its own commit: the two agree on a dashboard session-token handshake, and a version gap fails the app's readiness probe with 401 Unauthorized. PyPI trails the tags, so no published CLI can satisfy it, and Hermes refuses a non-editable install from a git checkout, so the CLI cannot be pinned to the app's commit either.

So /usr/bin/hermes-desktop sets HERMES_DESKTOP_IGNORE_EXISTING=1, which keeps the app off whatever hermes is on PATH, and the app provisions and manages its own runtime under ~/.hermes on first launch — the arrangement upstream ships, and the only one that starts. git and curl are dependencies because that bootstrap needs them.

That first launch is slow and large: a git clone plus a uv venv, past 2 GB. omacom/omarchy#7469 makes the terminal agent defer to this installation, so a machine ends up with one Hermes whichever way it got there.

Details worth knowing

  • The build stamp is pinned through $GITHUB_SHA. write-build-stamp.mjs pins the app's first-launch bootstrap to a commit and otherwise resolves it with git rev-parse — which is wrong under makepkg, since the build happens inside this repository and git ascends out of srcdir to stamp the app with an omarchy-pkgs commit.
  • The launcher asks for Wayland directly. Chromium's own Ozone detection falls back to XWayland often enough to matter, and the result is a blurry window on every scaled display. Skipped when the caller already named a platform.
  • The icon is upstream's own 1024×1024 app icon, downscaled at build time to 512/256/128/64/48 so menus don't smudge it.
  • chrome-sandbox takes setuid root only where unprivileged user namespaces are unavailable, matching grok-bot.

dhh added 3 commits August 19, 2026 01:53
Hermes pins every one of its ~120 dependencies with == and declares
Requires-Python >=3.11,<3.14, so it can neither be built against Arch's
Python 3.14 nor share the python-* packages, and Arch's next Python bump
would break any venv this package built. So it ships a wrapper instead and
lets mise give Hermes a private environment -- the arrangement
omarchy-mise-install already makes for the other coding agents.

Two things the wrapper has to work around. mise reads [...] as its own tool
options rather than as Python extras, so the extras have to be spelled
[extras=all]; written [all] they are dropped without a word and the install
comes out byte-identical to a bare one. And given no compatible interpreter
to hand, uv builds the venv against the system Python in violation of
Hermes' own bound, reports success, and leaves the breakage to surface later
inside some dependency. The interpreter is therefore pinned on install and
re-checked on every run, since mise up reinstalls without the pin.

The icon is upstream's own 1024x1024 app icon -- the mark the site serves as
its favicon -- downscaled at build time so menus don't smudge it themselves.
Both files changed after the sums were generated -- the wrapper learned to
fall back to hermes when invoked under an unknown name, and the desktop entry
dropped its second main category -- so makepkg rejected them.
Install > AI is for GUI apps, so the package becomes the desktop shell and the
terminal agent moves to a lazy mise stub that omarchy installs itself.

Nous builds Hermes Desktop for macOS and Windows only -- their download page
offers a .dmg and an .exe and points Linux users at a terminal install -- so
there is no vendor binary to repackage the way grok-bot repackages xAI's deb.
Their electron-builder config does carry a Linux target though, untested by
upstream but working: npm ci at the workspace root, npm run pack in
apps/desktop, and electron-builder stages node-pty and get-windows for
linux-x64 on its own. 337 MB unpacked, 129 MB packaged.

The app is only a shell -- it runs `hermes serve` against a CLI it does not
ship, and clones its own unpinned copy into ~/.hermes when it finds none. So
/usr/bin/hermes-desktop makes sure the CLI is there before handing over, and
says so plainly rather than bootstrapping a second Hermes where Omarchy's
installer isn't around to do it properly.
@omarchybot omarchybot changed the title Package Hermes as a mise-backed wrapper Build Hermes Desktop from source Aug 19, 2026
dhh added 5 commits August 19, 2026 02:51
Chromium falls back to XWayland often enough to matter, and the result is a
blurry window on every scaled display -- the same reason the ChatGPT and Grok
Bot launchers set this. Skipped when the caller has already named a platform.
Pin the build stamp. write-build-stamp.mjs resolves the commit the app pins
its first-launch bootstrap to, preferring $GITHUB_SHA and otherwise running
`git rev-parse`. That fallback is wrong under makepkg: the build happens
inside this repository, so git ascends out of srcdir and stamps the app with
an omarchy-pkgs commit that means nothing upstream. Confirmed by rebuilding --
the stamp now reads the tag's own commit rather than this repo's HEAD.

Ship upstream's MIT licence. The package declares MIT and was installing only
Electron's licence text.

Repair a drifted CLI before launching rather than only a missing one. `mise
up` can leave Hermes rebuilt against the system Python, and a stub can be
there but cold; either way the wrapper's own repair takes minutes while the
app allows 15 seconds before bootstrapping its own copy. Running the installer
unconditionally costs nothing when Hermes is healthy.

Register the hermes:// scheme. The desktop entry took %U while declaring no
MimeType, so the scheme electron-builder configures went unhandled.
The launcher only delegated to omarchy-install-hermes-cli and, when that was
absent, printed a warning to stderr -- which nothing sees under a graphical
launch -- and started the app anyway. The app then offered to install Hermes
itself, and that copy wins permanently: it checks ~/.hermes/hermes-agent
before it checks PATH, so installing the CLI afterwards changes nothing until
that directory is deleted.

So install it here when omarchy's script isn't around, with the same
interpreter pin and the same exported cooldown, and hand the app the real
executable by putting the mise install's bin directory on PATH instead of
leaving it to search. Its probe allows 15 seconds; resolving this way takes
0.2. mise and uv become dependencies, which is what makes the package
self-sufficient on a machine without Omarchy.
Built from v2026.8.18 against the CLI on PyPI, the app never starts: it
resolves the CLI, launches the backend, and then fails its readiness probe
with 401 Unauthorized. The two have to agree on the dashboard session-token
handshake -- the app scrapes window.__HERMES_SESSION_TOKEN__ out of the served
HTML, and web_server.py falls back to a random token when it cannot agree, so
every probe after that is rejected. A month separated the two: the tag was
2026-08-18, hermes-agent 0.19.0 on PyPI was 2026-07-20.

Upstream never meets this because their installer builds the app from the same
checkout it installs the CLI from. Pinning the CLI forward to the app's commit
is not open to us either -- Hermes refuses a non-editable install from a git
checkout and tells you to use `uv sync` instead. So the app is pinned back
instead, to the tag PyPI's current release was cut from.

Verified on a worker: the desktop reaches "Hermes backend is ready" and maps
its window, where the newer build stopped at the 401 every time.
Pairing the app with the mise CLI does not work, and pinning the app back to
the tag behind PyPI's release does not rescue it: v2026.7.20's desktop reaches
"backend is ready" and then hangs without ever opening a window, against its
own matching runtime. Only the newest app against a runtime built from its own
commit starts, which is the arrangement upstream ships.

So the package returns to the newest tag and the launcher sets
HERMES_DESKTOP_IGNORE_EXISTING, which keeps the app off whatever hermes is on
PATH -- on Omarchy that is the mise CLI installed for the terminal agent, a
different release, and the version gap is what produced the 401. The app
provisions ~/.hermes itself on first launch instead.

mise and uv are no longer dependencies, since the launcher no longer installs
anything; git and curl are, because the app's own bootstrap needs them.
@omarchybot omarchybot changed the title Build Hermes Desktop from source Add hermes-desktop Aug 19, 2026
@greptile-apps

greptile-apps Bot commented Aug 22, 2026 •

Copy link
Copy Markdown

Greptile Summary

Adds an Arch package for Hermes Desktop, building the upstream Electron application and allowing it to provision a commit-matched Hermes runtime.

  • Builds and packages the pinned upstream Hermes Desktop release.
  • Installs desktop metadata, application icons, licenses, and a launcher with Wayland handling.
  • Configures the Chromium sandbox permissions during package creation.

Confidence Score: 4/5

The PR is not yet safe to merge because the packaged Chromium sandbox can be unusable on target systems whose user-namespace support differs from the build host.

The package still derives chrome-sandbox permissions by probing the build environment, leaving packages built with mode 0755 unable to start Electron where the target requires the setuid sandbox.

Files Needing Attention: pkgbuilds/hermes-desktop/PKGBUILD

Important Files Changed

Filename Overview
pkgbuilds/hermes-desktop/PKGBUILD Builds and installs Hermes Desktop, but its sandbox permission decision still depends on the build host rather than the installation target.
pkgbuilds/hermes-desktop/hermes-desktop.sh Launches the packaged application with an isolated Hermes runtime and selects native Wayland unless the caller supplied an Ozone platform.
pkgbuilds/hermes-desktop/hermes-desktop.desktop Registers Hermes Desktop as a graphical application and handler for Hermes URLs.

Reviews (2): Last reviewed commit: "Reconcile Hermes ownership on every laun..." | Re-trigger Greptile

Comment on lines +128 to +132
# are unavailable; where they work, setuid root is the worse of the two.
if ! { [[ -L /proc/self/ns/user ]] && unshare --user true; }; then
chmod 4755 "${pkgdir}/opt/${pkgname}/chrome-sandbox"
else
chmod 0755 "${pkgdir}/opt/${pkgname}/chrome-sandbox"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Sandbox mode follows build host

If the build host supports unprivileged user namespaces but the target machine does not, package() archives chrome-sandbox as mode 0755 and the launcher performs no target-side adjustment, causing Electron to fail to start on that target.

Tidying the terminal agent's Hermes away only happened in the menu installer,
so `pacman -S hermes-desktop` on its own, or an install interrupted after the
package landed, left two Hermeses -- and by then the menu entry that would
have noticed is disabled, because we are installed.

Co-Authored-By: Codex XHigh <noreply@openai.com>
@dhh
dhh merged commit 292d27a into master Aug 25, 2026
1 check passed
@dhh
dhh deleted the hermes-agent branch August 25, 2026 05:49
maralcbr referenced this pull request in maralcbr/omarchy-pkgs Sep 20, 2026
Report disk shortfalls with numbers before downloading (#166)
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