Skip to content

Recognize an existing Hermes Desktop install in the menu and launcher - #11000

Closed
KelpME wants to merge 14 commits into
omacom:quattrofrom
KelpME:hermes-existing-install-detect
Closed

KelpME wants to merge 14 commits into
omacom:quattrofrom
KelpME:hermes-existing-install-detect

Conversation

@KelpME

@KelpME KelpME commented Sep 9, 2026 •

Copy link
Copy Markdown

Install > AI > Hermes offers to install Hermes Desktop on machines where it is already installed, and the launcher hides the one entry that works. Both answer only omarchy-pkg-present hermes-desktop, but the desktop app can be on the machine without the package: the upstream runtime's own installer writes a hermes.desktop launcher and a complete install under ~/.hermes before Omarchy ever asks. That is everyone who set Hermes up before Omarchy shipped Hermes support, and everyone who installed it from upstream since. For them the menu keeps offering a redundant package install — clicking it adds the package alongside the working runtime and changes nothing about the menu's picture of the machine — and since 9fb73b0, the static hermes line in launcher.hides hides their only working launcher entry, so search cannot open an app that is there and running. On the incomplete standalone installs the old offer is worse than redundant: a runtime without its built app fails the installer's own integrity checks and dead-ends in "The Hermes runtime has moved beyond the packaged desktop release".

The hide moves with ownership instead of being static. hidden-entries.sh already produces the launcher's hidden list at runtime, so it now emits hermes only while the hermes-desktop package is present — exactly the condition the packaged takeover assumes — and the static line leaves launcher.hides. A packaged install hides the upstream entry as before; a standalone install keeps it, because it is the only launcher the app has. The remover finishes what removal starts: it deletes the runtime's launcher entry once the command its Exec names is gone — and since the launcher re-reads hidden entries only when a .desktop file changes, that deletion is itself the event that refreshes the list. For a runtime deleted by hand rather than through Remove, the scan resolves the entry's Exec target — quoted or bare, arguments stripped per the desktop-entry spec, the spec's string escapes (\s, \n, \t, \r, \\) decoded first, a bare name looked up on PATH — and keeps it hidden when the target no longer exists; an escape the decoder does not know hides the ID while leaving the entry alone. Both the scan and the remover read the entry where the runtime wrote it, under ${XDG_DATA_HOME:-$HOME/.local/share}/applications, the same resolution omarchy-remove-launcher-entry already uses. A working standalone entry always resolves and stays visible.

The Install row learns the same second answer through a new hidden helper, omarchy-hermes-desktop-present. Putting the check in a command rather than inline guard text keeps one definition of "a standalone install is complete": the helper mirrors the installer's home resolution — HERMES_HOME wins, a path under a profiles directory flattens to the shared root above it — and then reads the same files the installer's own readiness checks read, the bootstrap marker, the venv commands, and the native app's binary, app.asar and install stamp. File tests only: the guard batch runs per menu open, and no probe ever launches Hermes. The row dims (✓) only when a complete install is there; an incomplete one keeps the Install action active. The installer itself is left alone on purpose: with the guard fixed, a working install is dimmed before it can be clicked, and teaching the installer to adopt foreign runtimes would be a different conversation than detecting them. Removal stays package-only: a bootstrap marker is written by upstream's ordinary installer too, so it does not establish Omarchy ownership, and widening removal is a separate question.

Verified

  • test/shell.d/hermes-desktop-present-test.sh (new): the helper against throwaway homes — a complete default-home install recognized; a profiles/ptah home normalized to the shared root before checking (and a runtime parked under the profile directory itself rejected); HERMES_HOME honored; an install missing each of the six required files not reported present; nothing at all answers false. 5 ok.
  • test/shell.d/hidden-entries-test.sh (new): hermes hidden with the package present; visible without it when the Exec target exists; hidden again when the target is gone; a quoted Exec (Exec="<home>/.local/bin/hermes" desktop) resolves the quoted binary; a bare Exec command is resolved on PATH; a relative Exec is left to the launcher; an escaped Exec (Hermes\sDesktop) resolves to its decoded target and is judged dead once that target is gone; an escape the decoder does not know hides the ID while leaving the entry on disk; a dead hermes.desktop under a custom XDG_DATA_HOME is scanned and hidden. 11 ok.
  • test/shell.d/hermes-remove-test.sh (new cases): removal deletes the launcher entry whose Exec target is gone — itself the .desktop change that triggers the launcher's rescan; an entry that still launches something survives; a bare Exec command on PATH survives; a relative Exec survives unread; an escaped Exec is decoded before judging, so a decoded target that is gone gets the entry deleted while an escape the remover cannot decode keeps it; the entry under a custom XDG_DATA_HOME is deleted just like the default-path one. 28 ok.
  • The guard was exercised through the real guardScript batch wrapper across four states: standalone install without the package (dimmed ✓), clean machine (active), packaged install (dimmed ✓), incomplete standalone install (active). bash -n clean on the generated script.
  • ./test/cli: green. Focused Hermes/menu suites (hermes-desktop-install, hermes-cli, hermes-remove, hermes-cli-migration, app-search, menu, menu-guards): green on the rebase onto 8ea5151.

Fixes #11628

@spencerbull spencerbull left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Changes requested on 09eb1a2b3dad1d2ff89c6bf9678a85f0b95d6563, reviewed against quattro at 8ea51516390320f8e768808b230098e67bdaa82c.

This still addresses a real standalone-install problem after #10613 and #10846. The conditional launcher hide needs to handle removal, and the new installed-state guard needs to match the installation it describes.

  1. P2 — Removing packaged Hermes exposes a broken launcher. At shell/services/hidden-entries.sh:98, hiding hermes only while the package is installed makes the upstream entry visible after removal. The existing remover deletes the native runtime and its owned CLI wrappers but leaves ~/.local/share/applications/hermes.desktop. Running the actual remover and hidden-entry scanner in a disposable worker confirmed that removal succeeds, the entry survives, its Exec target is gone, and this PR exposes the entry where the base hides it. Please handle the launcher whose target is removed while preserving working standalone entries, and add coverage for install/update → removal → launcher refresh.

  2. P2 — The menu guard can inspect the wrong Hermes installation. At default/omarchy/omarchy-menu.jsonc:246, the new check hardcodes ~/.hermes, whereas the installer respects HERMES_HOME and normalizes profile paths to their shared root. With a complete old default tree and an empty selected custom home, the generated guard disables Install even though the selected installation is absent. Conversely, complete standalone custom-home and profile-home installations remain undetected. Please use the same home normalization as the installer and cover both directions. The false-positive is introduced here; the custom-install false-negative is an existing target scenario this change leaves unresolved.

  3. P2 — Incomplete standalone installations are reported as installed. The same guard accepts a bootstrap marker and an executable without checking the required runtime and desktop files. The generated guard still disabled Install with the venv missing, resources/app.asar missing, or resources/install-stamp.json missing. Please align the inexpensive file checks with the installer's completeness requirements and add incomplete-install cases, so a broken installation does not suppress the Install action. Avoid adding long launch/version probes to every menu open.

Please also correct the description's claim that a stale standalone marker leaves Remove reachable: remove.ai.hermes remains package-only. Widening removal is not implied by standalone detection; upstream's ordinary installer writes the same bootstrap marker, so that marker alone does not establish Omarchy ownership.

The existing #10613 behavior that prevents duplicate launchers after native updates should remain intact for packaged installs. #10846 fixes the relocated Python stamp helper and the menu icon and does not supersede this PR.

GPT-6 in Codex/T3 Code reviewed the change, with a second GPT-6 reviewer at xhigh. The second reviewer identified the removal regression and wrong-home false-positive, and the primary reviewer independently verified the source and reproduced both; it also identified the incomplete-install coverage gap. The second review was instructed not to consult the primary transcript, but read-scope isolation was not enforced. The PR combined cleanly with current quattro; 315 focused CLI, launcher, menu, guard, installer, and remover checks passed in a disposable credential-free worker. Separate probes reproduced the cases above. The full shell suite and rendered GUI installation/update/removal flow were not run.

This is an automated Omabot review posted on behalf of @spencerbull.

🤖 Generated by GPT-6 in Codex/T3 Code. Reviewed by GPT-6 at xhigh.

KelpME added 3 commits September 9, 2026 20:27
- hidden-entries.sh resolves the hermes entry's Exec target (quoted or
  bare, arguments stripped per the desktop-entry spec) and keeps it
  hidden when the target no longer exists: the remover tears down the
  runtime but leaves the launcher entry behind.
- New hidden helper omarchy-hermes-desktop-present mirrors the
  installer's home resolution and reads every file its readiness checks
  read, so the Install row dims only for a complete standalone install.
- Menu guard delegates to it; fixture Exec paths and test ordering fixed.
@KelpME
KelpME force-pushed the hermes-existing-install-detect branch from 1e5f2fe to 6d598f0 Compare September 10, 2026 02:28
@KelpME

KelpME commented Sep 10, 2026

Copy link
Copy Markdown
Author

Thanks for the review — all three P2s confirmed against source and addressed, pushed on top of the rebased 8ea5151.

P2-1 (removal exposes a dead launcher): hidden-entries.sh now resolves the entry's Exec target — quoted or bare, arguments stripped per the desktop-entry spec — and keeps hermes hidden when the target no longer exists. A working standalone entry resolves and stays visible; the entry the remover leaves behind hides again. Covered by three new cases in hidden-entries-test.sh (target present → visible, target removed → hidden, quoted Exec resolves).

P2-2 (guard inspects the wrong home): the inline guard is gone. A new hidden helper, omarchy-hermes-desktop-present, mirrors the installer's home resolution (HERMES_HOME override, profiles-dir flattening — lifted from omarchy-install-ai-hermes's own normalization) and is the single definition of "a standalone install is complete." Menu guard is now omarchy-pkg-present hermes-desktop || omarchy-hermes-desktop-present. Covered in hermes-desktop-present-test.sh: profile home flattens to the shared root, a runtime parked under the profile directory is rejected, HERMES_HOME is honored.

P2-3 (incomplete installs read as installed): the helper reads all eight files the installer's readiness checks read — bootstrap marker, venv hermes/python (f+x), native Hermes (f+x), app.asar, install-stamp.json. File tests only; no launch probes. The test drops each file in turn and requires the helper to answer false for every one.

Description: corrected — Remove stays package-only, and the body now says so explicitly (a bootstrap marker is written by upstream's ordinary installer too, so it alone establishes nothing about ownership).

Rebased onto 8ea5151 (no conflicts with #10846's installer changes — it touches bin/omarchy-install-ai-hermes, this PR doesn't). Focused suites: hermes-desktop-install, hermes-cli, hermes-remove, hermes-cli-migration, app-search, menu, menu-guards, bin-style, plus the two new files — all green.

spencerbull and others added 5 commits September 9, 2026 22:21
The default-home case built its runtime at <home>/hermes-agent while the helper reads <home>/.hermes/hermes-agent, so it failed on a clean machine and passed only where a developer's own HERMES_HOME pointed at a complete install. It now builds under .hermes and empties HERMES_HOME so nothing outside the fixture can answer for it. The profile case said it parked a runtime under the profile directory but built an unused tree beside it; it parks one there now, so a helper that stopped flattening is caught by that case. The HERMES_HOME case gets its own tree instead of borrowing the default home's.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…and is gone

The launcher re-reads its hidden entries only when a .desktop file changes. Removing the package changes one, and that rescan runs while the runtime and its wrapper still exist, so the upstream entry is judged live; the teardown that follows deletes its command without touching any .desktop file, and nothing rescans. On a runtime of realistic size the last rescan lands more than a second before the teardown finishes, and the launcher keeps offering a Hermes that launches nothing until some unrelated entry changes. Deleting the entry from the remover, when the command its Exec names no longer exists, is itself the change that triggers the rescan, and an entry that still launches something is left alone. The scan's own dead-target rule stays for a runtime deleted by hand, and its comments now say so.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
A desktop entry may name its command without a path, and the launcher resolves that on PATH. Testing it with -e answered against the working directory instead, so a hand-written entry naming a working command read as dead: the scan would hide it, and the remover, which deletes an entry whose command is gone, would delete it. Both now look a bare name up on PATH and check a path where it points.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Codex XHigh <noreply@openai.com>
A desktop entry's Exec may be relative, resolved by the launcher against the entry's own Path=. Neither the scan nor the remover reads Path=, so checking such a command with -e answered against their own working directory: the scan hid the entry and the remover deleted it. A relative command is now taken as live by both, and only an absolute path or a bare name is judged.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Codex XHigh <noreply@openai.com>
The remover and the hidden-entries scan call omarchy-cmd-present, and the tests running them put only their stub directory ahead of PATH, so the helper came from an installed Omarchy and was missing on a bare checkout, where the cases naming a command on PATH failed. The checkout's bin/ now follows the stubs on PATH, as docs/testing.md says tests must never depend on an installed Omarchy.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Codex XHigh <noreply@openai.com>
@spencerbull

Copy link
Copy Markdown
Contributor

Re-reviewed at 2bdc5e82, five commits pushed on top of 6d598f05, against quattro at 8ea51516.

What moved since the last round. P2-2 and P2-3 are fixed as described: the helper mirrors the installer's HERMES_HOME and profile flattening, and the guard batch, generated by the real guardScript and run under bash -lc on a worker, dims the row for a complete standalone install in the default home and through a profile path, and keeps it active on a clean machine and with app.asar missing. P2-1 was fixed in the scan but not in the sequence that produces it, and the helper's test could not pass on a clean machine. Five commits went to this branch, each with its reason in the commit body:

  • bd7b9e1b: hermes-desktop-present-test.sh built its default-home fixture at <home>/hermes-agent while the helper reads <home>/.hermes/hermes-agent, so its first case fails on any machine that does not export HERMES_HOME pointing at a complete install. On a worker the original file fails, and passes only with HERMES_HOME set to an unrelated complete install. The case now builds under .hermes with HERMES_HOME emptied. The profile case built an unused empty-profiles tree; it now parks a runtime under the profile directory itself, and a helper without flattening fails it.
  • dcb37636: the launcher re-reads hidden entries only when a .desktop file changes. On a worker running the real shell and the real hermes-desktop package, removing the package triggers three rescans, and all three run while ~/.local/bin/hermes still exists, so hermes is judged live. With a runtime of 100k files the remover's teardown finishes 1.2 s after the last rescan, nothing rescans, and the launcher keeps offering a Hermes that launches nothing. The remover now deletes ~/.local/share/applications/hermes.desktop when the command its Exec names is gone, which is itself the change that triggers the rescan; rerun with the fix, the entry vanishes and two rescans follow the teardown. An entry whose command still exists is left alone. The scan's dead-target rule stays for a runtime deleted by hand, and the two comments that said the remover leaves the entry behind now say that.
  • e66acafd and 1b13b50a: both the scan and the remover judged the Exec command with -e against their own working directory. A bare name such as Exec=hermes-custom desktop that resolves on PATH read as dead, and a relative command that the launcher resolves against the entry's own Path= read as dead too: hidden by the scan, deleted by the remover. Both now check an absolute path where it points, look a bare name up on PATH, and leave a relative command to the launcher.
  • 2bdc5e82: the tests running the remover and the scan put only their stubs ahead of PATH, so omarchy-cmd-present came from an installed Omarchy and was missing on a bare checkout. The checkout's bin/ now follows the stubs, per docs/testing.md.

Left as caveats, not changed. The helper skips the installer's hermes --version probe on purpose, since the previous round asked for file tests only in a guard that runs on every menu open; an install with every file present but a broken interpreter dims the row, and the installer would refuse to repair that install too unless its checkout sits at the packaged release commit. The scan reads $HOME/.local/share/applications without XDG_DATA_HOME, like the rest of hidden-entries.sh. The scan runs in the shell's non-login environment, as AppLibrary.qml requires, so a bare command reachable only through a login profile stays hidden, as it was before this change.

Description. The paragraph saying the remover leaves the runtime's launcher entry behind and that the scan returns the launcher to its pre-install state no longer describes the branch: the remover deletes the entry, and the scan covers a runtime deleted by hand.

Checked, on a disposable worker built from the Omarchy ISO with the shell serving this branch. ./test/cli green. The Hermes, menu, launcher, guard and style suites green. The full ./test/shell at 238 files: 3221 passed, 2 failed, in the same four files that fail on quattro at 8ea51516 on the same worker (ascii-test.sh, branding-about-animation-test.sh, config-test.sh, locate-test.sh), none of which touch this change. Each pushed fix was proven by mutation: reverting it fails exactly the case added for it. The rendered GUI install flow was not run.

Second opinion. Codex at xhigh reviewed three heads, the bound set for this review. On 6d598f05 it agreed with the two findings above, which were already written down, so its independence there is not guaranteed; it added the hermes --version and XDG_DATA_HOME points, recorded above as caveats. On dcb37636 it found the bare-name deletion that e66acafd fixes. On e66acafd it found the relative-command deletion and the test's dependence on an installed helper, fixed in 1b13b50a and 2bdc5e82, and raised the login-profile PATH point recorded above as a caveat. Those last two commits have no codex round of their own.

Waiting on the maintainer.

This is an automated Omabot review posted on behalf of @spencerbull.

🤖 Generated by Claude Fable 5.1 in Claude Code. Reviewed by Codex XHigh.

@KelpME

KelpME commented Sep 11, 2026

Copy link
Copy Markdown
Author
  • hermes --version probe skipped: deliberate. The risk isn't the probe on a healthy install — it's the failure path the installer itself wraps in timeout 15 (omarchy-install-ai-hermes line 40), because a broken interpreter can hang; inside the menu's guard batch that would be up to 15 seconds of delayed guard results on every menu open, versus file tests that are instant in every state. And the false-dim it would prevent is rare: the venv pins its own interpreter under .hermes-runtime/python/generation-*/, so system Python upgrades — the usual way a venv dies — don't touch it. When the installer refuses to repair (dirty checkout, HEAD past the release commit), a re-run wouldn't repair either. If a freshness check that can never execute Hermes and never blocks turns up later, it belongs in this helper.
  • No XDG_DATA_HOME: the scan reads $HOME/.local/share/applications exactly like the rest of hidden-entries.sh already did. Changing just the hermes branch would make this PR's scan disagree with itself line to line; changing the whole file is out of scope for a detection fix.
  • Login-profile PATH: pre-existing behavior inherited from AppLibrary.qml running the scan non-login — a bare command reachable only through a login profile stays hidden on quattro today, and this PR leaves that picture unchanged rather than quietly expanding what the launcher sees.

Verified section refreshed to describe the branch as it stands: hidden-entries-test.sh corrected (7 ok, including the bare-PATH and relative-Exec cases), and hermes-remove-test.sh's launcher-entry cases are now listed (24 ok across the suite). Both re-run green on 2bdc5e82 today, along with hermes-desktop-present-test.sh (5 ok).

A desktop entry's Exec may carry the spec's string escapes, \s for a space among them, which the launcher decodes before it runs the command. Neither the scan nor the remover decodes them, so a valid entry whose path holds one was checked at a path that does not exist: the scan hid it and the remover deleted it. A command carrying an escape is now taken as live by both, like a relative one, since what cannot be read cannot be judged dead.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Codex XHigh <noreply@openai.com>
@spencerbull

Copy link
Copy Markdown
Contributor

Re-reviewed at 33b20ca9, one commit pushed on top of 2bdc5e82, against quattro now at 31bd80da.

What moved. No code since the last round until this commit; the description's removal paragraph and Verified section now describe the branch, and the three caveats were answered. The base gained six commits, two on files this branch touches (omarchy-menu.jsonc gains the Claude Desktop rows, menu-test.sh widens the font range); the branch merges cleanly, and that merge is what the suites below ran on.

  • 33b20ca9: a desktop entry's Exec may carry the spec's string escapes, \s for a space among them, which the launcher decodes before running the command. Neither the scan nor the remover did, so a valid entry such as Exec="/home/u/Hermes\sDesktop/bin/hermes" desktop was checked at a path that does not exist: hidden by the scan, deleted by the remover. Both now treat a command carrying an escape as live, like a relative one, since what cannot be read cannot be judged dead. Found by Codex at xhigh; proven by mutation on a worker.

The three caveats, checked against the source. The skipped hermes --version probe holds: the installer wraps it in timeout 15, the guard batch runs its expressions in sequence and applies results when the process exits, and upstream keeps the venv's interpreter under its own .hermes-runtime/python/generation-* store, so a system Python upgrade does not reach it. One qualification: the installer does repair a clean runtime sitting at the packaged release commit, so an install with every file present but a broken interpreter dims a row whose action would have repaired it; that is the trade-off the earlier round asked for, and it stays. XDG_DATA_HOME holds as scope: the rest of the file reads the same directory. Login-profile PATH: the scan runs non-login by design in AppLibrary.qml while launch goes through a login shell, so a bare command added to PATH by a profile edit mid-session stays hidden until the next login; the base hid hermes outright, so this check only ever un-hides more, and it stays as it is.

Checked, on a disposable worker built from the Omarchy ISO with the shell serving the branch merged onto 31bd80da. ./test/cli green. The Hermes, launcher, menu, guard and style suites green. The full ./test/shell at 238 files: 3226 passed, 2 failed, in the same four files that fail on quattro alone on the same worker (ascii-test.sh, branding-about-animation-test.sh, config-test.sh, locate-test.sh), none of which touch this change. The rendered GUI install flow was not run.

Second opinion. Codex at xhigh reviewed 2bdc5e82, including the two commits from the last round that had no round of their own, together with the author's three arguments. It found the escape case fixed here, found nothing in those two commits, judged the base's six new commits to add no Hermes interaction, and re-raised the login-profile PATH point, which stays a caveat for the reason above. This commit has no codex round of its own.

Waiting on the maintainer.

This is an automated Omabot review posted on behalf of @spencerbull.

🤖 Generated by Claude Fable 5.1 in Claude Code. Reviewed by Codex XHigh.

@smfworks

Copy link
Copy Markdown
Contributor

Checked out 33b20ca9 against current quattro on a live Omarchy box whose Hermes is a git install (~/.hermes/hermes-agent, native linux-unpacked/Hermes, not the hermes-desktop package).

omarchy-hermes-desktop-present exits 0 here even when HERMES_HOME is a profile (~/.hermes/profiles/james) — the flatten-to-shared-root path is the one this machine actually uses. That is the Install-row dim this PR is for.

Focused suites on this tree: hermes-desktop-present-test.sh, hidden-entries-test.sh, hermes-remove-test.sh, app-search-test.sh, menu-guards-test.sh — all green.

This is the right seam. Do not open a second detector PR. GitHub still shows CHANGES_REQUESTED from the 10 Sep review; the later rounds look resolved. Waiting on maintainer is correct.

@spencerbull

Copy link
Copy Markdown
Contributor

Re-reviewed at 33b20ca9, unchanged since the last round, against current quattro at b679363b. The base advanced from 31bd80da without touching any file in this PR, and the current merge tree is clean. The new live report confirms the positive HERMES_HOME=~/.hermes/profiles/... case, and #11628 independently reproduces the launcher disappearance this PR is meant to fix.

Two P2 gaps remain in the stale-launcher path:

  1. A custom XDG_DATA_HOME bypasses both cleanup checks. bin/omarchy-remove-ai-hermes:139 and shell/services/hidden-entries.sh:127 look only under ~/.local/share/applications. Hermes v2026.9.7 writes hermes.desktop under ${XDG_DATA_HOME:-$HOME/.local/share}/applications, and current Omarchy already uses that same resolution in omarchy-remove-launcher-entry. With a custom data home, Remove tears down the default runtime but neither deletes that entry nor generates a .desktop event there; later scans never inspect it. Because this branch removes the static hermes hide, the dead entry remains visible. Please resolve the user applications directory from XDG_DATA_HOME in both paths and cover removal plus rescan there.

  2. An escaped Exec is always treated as live, including after its target disappears. launcher_entry_runs and exec_target_exists return success as soon as the parsed target contains any backslash. desktop-file-validate accepts the branch's own example, Exec="/home/u/Hermes\sDesktop/bin/hermes" desktop; after that binary is removed, the remover preserves the entry and the scanner leaves it visible. The new tests cover only the target-present direction. Please decode the supported desktop-entry escapes, or preserve an unreadable entry while still hiding its ID when liveness cannot be established, and add the missing target-gone cases.

The earlier wrong-home and incomplete-install findings are fixed. Default-path launcher cleanup is fixed, but the two cases above mean that prior stale-launcher finding is not fully closed. The skipped hermes --version probe remains an explicit menu-latency trade-off, and login-profile-only PATH resolution remains outside the non-login scanner's environment; neither changes this verdict.

A fresh disposable-worker run was attempted for this exact integration, but the configured worker template snapshot is currently unavailable, so no new suite result is claimed. The same PR head previously passed ./test/cli, focused Hermes/menu/launcher suites, and the full shell suite against 31bd80da; smfworks separately reports the focused suites green and confirms the profile-home case on a live git install. The rendered GUI flow remains unrun.

GPT-5.6 Sol at xhigh supplied the two findings in a second-opinion pass; I verified both against this exact head, current Omarchy source, and Hermes v2026.9.7 source. Read-scope isolation from the primary transcript was requested but not enforced.

Verdict: NEEDS AUTHOR. This is still the right seam and directly addresses #11628 once the cleanup path handles these two states. Waiting on the author.

This is an automated Omabot review posted on behalf of @spencerbull.

🤖 Generated by GPT-5.6 Sol in Codex/T3 Code. Reviewed by GPT-5.6 Sol at xhigh.

Two states left a stale Hermes launcher visible or undeletable:

The runtime writes its entry under the XDG data home, wherever that
is; a custom XDG_DATA_HOME left $HOME/.local/share alone to delete,
and left the scan blind to an entry the launcher still saw. Both now
resolve the directory the way omarchy-remove-launcher-entry already
does.

The desktop-entry escapes the launcher decodes before running the
command were also decoded by neither, so an entry such as
Exec="/home/u/Hermes\\sDesktop/bin/hermes" was judged at a path
that does not exist -- hidden by the scan, preserved by the remover,
whatever lived at the decoded path. Both now decode the command first
and judge that; an escape the decoder does not know is left to the
launcher, like a relative command.
@KelpME

KelpME commented Sep 15, 2026

Copy link
Copy Markdown
Author

Both findings are fixed in 9291f56d, tested in the two suites that cover the path.

Custom XDG_DATA_HOME. Both the remover (omarchy-remove-ai-hermes) and the scan (hidden-entries.sh) now resolve the user applications directory the way omarchy-remove-launcher-entry already does: $XDG_DATA_HOME/applications when set, $HOME/.local/share/applications otherwise. Removal plus rescan are covered there: a runtime-registered entry under a custom data home is deleted by the remover, and a dead hermes.desktop under one is hidden by the scan. Both cases are in the suites (hermes-remove-test.sh, hidden-entries-test.sh), and I ran the remover end-to-end against a custom XDG_DATA_HOME on a scratch HOME -- the entry goes, exit 0.

Escaped Exec. The blanket "any backslash is live" rule is gone from both launcher_entry_runs and exec_target_exists. They now decode the desktop-entry string escapes -- \s, \n, \t, \r, and \\ -- and judge the decoded command exactly like an unescaped one: absolute paths are checked where they point, bare names on PATH. An escape the decoder does not know still leaves the command unreadable, and unreadable gets the treatment from your alternative reading: the remover preserves the entry, the scan hides its ID. The target-gone direction is covered now too -- an entry like Exec="/home/u/Hermes\sDesktop/bin/hermes" desktop whose decoded target has disappeared is deleted by the remover and hidden by the scan, with the target-present cases kept alongside.

Suites on 9291f56d, run serially on this machine: hidden-entries-test.sh 11 ok, hermes-remove-test.sh 28 ok, menu-guards-test.sh 18 ok, hermes-desktop-present-test.sh 5 ok, app-search-test.sh 27 ok. Nothing failing.

The two standing caveats are unchanged from your last round: the skipped hermes --version probe stays a menu-latency trade-off, and login-profile-only PATH stays outside the non-login scanner's environment.

@spencerbull

Copy link
Copy Markdown
Contributor

Re-reviewed 9291f56df0cce0e89f9964c59022c61fb4e87969 against quattro at 45748a2812f42e32f915b053caf4074e150e2048. One P2 launcher defect remains; full E2E verification is blocked.

The previous custom-XDG_DATA_HOME finding is addressed in both paths, and the ordinary \s target-present/target-gone cases now have matching implementation and regression coverage. Those conclusions are from source inspection, not a new execution of the suites.

P2 — quoted executable paths are decoded only once. The decoder in hidden-entries.sh:115–129, duplicated in omarchy-remove-ai-hermes:75–88, implements the general string-escape layer but omits the quoted-command layer. For example, this valid desktop-file value targets an executable whose directory contains a literal dollar sign:

Exec="/tmp/Hermes\\$Desktop/hermes" desktop

GLib resolves that executable to /tmp/Hermes$Desktop/hermes. The new decoder instead checks a pathname with a literal backslash before the dollar sign. If only the real executable exists, the scanner hides its working launcher; the remover can delete that still-valid desktop entry when its cleanup block runs. Four backslashes in a quoted value have the same mismatch: the launcher resolves one literal backslash, while this decoder retains two. This differs from the previous revision, which preserved escaped targets. Decode both layers with quote-aware tokenization and cover live/dead targets before treating an escaped entry as safe to delete.

I verified the expected decoding with the installed GLib key-file and argument parsers using synthetic strings only; nothing was launched and no contributor code was executed. This matches the desktop-entry specification and GLib's launch parsing. Omarchy's actual launch path is uwsm-app -- gtk-launch.

Checks completed: clean merge tree with current quattro, clean git diff --check, syntax checks for all seven changed shell files, source review of menu guards, launcher filtering, home normalization, removal, and the added tests. The new checks do not execute Hermes or evaluate desktop-entry commands. This is a scoped source review, not a security or regression clearance.

Not run: CLI/shell suites, graphical acceptance, real Hermes CLI/Desktop installation and launch, lifecycle/removal tests, and screenshot capture. Omabot's configured dedicated SSH keys are missing in this environment, and its Proxmox connection fails host-key verification. No worker was created. No screenshots or E2E success are claimed, and no fix was pushed without worker verification. The separate bootstrap-marker issue #12206 / PR #12487 should also be distinguished during the eventual install run; this PR directly addresses #11628.

GPT-6 in Codex/T3 Code performed the primary review. GPT-5.6 Sol at xhigh supplied the second opinion and the escape-layer finding, which I checked against source, the specification, and the trusted GLib parser probe. Read-scope isolation from the primary transcript was requested but not enforced.

Waiting on test-environment access to reproduce the full desktop flow, verify a small fix, and attach actual screenshot evidence. This review does not establish readiness to merge.

🤖 Generated by GPT-6 in Codex/T3 Code. Reviewed by GPT-5.6 Sol at xhigh.

@KelpME

KelpME commented Sep 26, 2026

Copy link
Copy Markdown
Author

P2 fixed and branch updated to current quattro.

Quoted-token decode (the remaining P2)

The decoder in hidden-entries.sh and omarchy-remove-ai-hermes now applies the second layer you flagged: after the key-file string escapes, it decodes the token layer GLib's launch parser applies to the Exec value, where a backslash escapes $ ` " \ .

  • Exec="/tmp/Hermes\\$Desktop/hermes" desktop now resolves to /tmp/Hermes$Desktop/hermes, the path the launcher would actually run
  • Four backslashes collapse to one literal backslash, matching GLib
  • Any backslash the decoder can't account for still fails safe: the scan hides the ID as unjudgable and the remover keeps the entry, never judging it dead

New tests cover live and dead targets in both hidden-entries-test.sh and hermes-remove-test.sh.

Upstream merge (why the branch showed conflicts)

Merged upstream/quattro at e1614f2b. Context shift worth noting:

  • Upstream's remover refactor replaced ensure_hermes_stopped with hermes_holders check/stop — removal now stops Hermes itself rather than asking
  • The mise CLI teardown no longer exists in upstream's remover
  • Our launcher_entry_runs() and the dead-entry deletion were re-homed into the new flow unchanged; the stale mise-CLI test was removed to match
  • All 65 of upstream's remover tests are preserved

Tests

  • hidden-entries-test.sh: 13/13
  • hermes-remove-test.sh: 36/36
  • Full ./test/cli + ./test/shell A/B against a pristine upstream/quattro checkout on the same machine: zero assertions fail on this branch that pass on pristine quattro
  • The 11 assertions failing on both sides are pre-existing (missing omarchy-pkgs checkout, snapper, VM-mount boundary, bar-icon geometry — upstream churn plus machine-shaped environment)
  • This is a local A/B, not CI clearance

Still blocked on the worker

No E2E/graphical acceptance, no real install/launch, no removal lifecycle run, no screenshots — Omabot's SSH keys and Proxmox host-key verification are still unavailable. Requesting a worker run for those.

Bootstrap-marker issue #12206 / PR #12487 remains separate from this PR (#11628).

@omarchybot omarchybot added the enhancement New feature or request label Oct 3, 2026
hidden-entries-test.sh was an add/add conflict: upstream rebuilt the
suite around a scratch HOME, XDG_DATA_DIRS, LC_ALL=C and an exact-output
assertion over 14 fixtures (nested IDs, user overrides, OnlyShowIn/
NotShowIn, a Desktop Action section, unusual filenames, a literal
ven[dor]* dir, nix-profile), all scanned with the desktop filter arg;
our side had kept Hermes coverage: package-present hides the upstream
launcher, dead Exec targets (absolute, quoted, escaped \s, quoted-token
$) hide it too, and the entry is read from XDG_DATA_HOME wherever it
points. The resolved suite keeps both: upstream's exact-output scan runs
first, before any Hermes fixture exists so nothing pollutes its set,
then the Hermes cases reuse the upstream harness conventions (entry()
helper, exported scratch HOME, filter arg on every scan) with our
stubbed omarchy-pkg-present still prepended to PATH. The scan inherits
a caller's XDG_DATA_HOME, which would steal the user-applications dir
from under the fixtures, so the suite unsets it up front.
@KelpME

KelpME commented Oct 15, 2026

Copy link
Copy Markdown
Author

Branch merged to current quattro — mergeable again.

80a5ef4d merges upstream quattro at c582e1d7. The only collision was hidden-entries-test.sh: upstream wrote its own version of that suite independently, so the file now keeps your nested-ID / override / desktop-filter assertions and ours (dead and escaped Exec, the quoted-token layer, custom XDG_DATA_HOME) in one suite, in your harness's conventions.

No product code changed in the merge — the auto-merged hunks in hidden-entries.sh, omarchy-remove-ai-hermes, and omarchy-hermes-desktop-present compose as before, and the quoted-token decode from the last round is untouched.

Focused suites on 80a5ef4d, run serially on this machine: hidden-entries 14 ok, hermes-remove 36 ok, menu-guards 26 ok, hermes-desktop-present 5 ok, app-search 27 ok.

The quoted-token finding stands addressed as of cef63f9e; your review predates that commit.

@greptile-apps

greptile-apps Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge, with the earlier non-blocking escaped-quote issue still outstanding.

Findings

  1. P2 Escaped quotes hide working Hermes ▶

Summary

The PR recognizes complete standalone Hermes Desktop installs and keeps their launcher visible without the package.

  • The Hermes Install row recognizes complete standalone installs.
  • Hermes search shows the working launcher that matches package ownership.
  • Hermes removal clears its launcher entry when the command is gone.

Reviews (2) · Last reviewed commit: "Describe the Exec decoders as they now b..." · Reviewed by Greptile

Comment on lines +96 to +98
if [[ $target == \"*\"* ]]; then
target=${target#\"}
target=${target%%\"*}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Escaped quotes hide working Hermes

If the executable path contains a literal double quote, the quoted Exec parser stops at the escaped quote rather than the closing quote. The shortened path fails the check, so a working standalone Hermes entry stays hidden. Decode the string first, then read the command with escape-aware quote handling. Add a test for an escaped quote inside the executable path.

@omarchybot omarchybot added bug Something isn't working and removed enhancement New feature or request labels Oct 15, 2026
Both function headers still said an escape is never read and the entry is taken as live, which stopped being true once the decoders learned the string and quoted-token escapes: the scan now hides the ID for an escape it cannot decode, while the remover keeps the entry. The merge from quattro also left a stray one-line copy of the hermes_holders comment above its first call.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@omarchybot omarchybot added the verified Omarchy Triage has verified that this issue is ready for final review label Oct 15, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

Reviewed at c30bed75 against quattro at c582e1d7. The bug is real and this fixes it, but the change is larger than the bug needs. It is waiting on the maintainer.

Reproduced on an Omarchy worker. I set up a standalone Hermes with no hermes-desktop package and a hermes.desktop pointing at a live executable. On quattro the hermes ID is hidden, so the only launcher entry disappears (#11628, now linked to close with this). On this branch it stays visible. With the hermes line put back in launcher.hides it is hidden again. The Install > AI > Hermes row dims for a complete standalone install only on this branch. On the worker:

  • ./test/cli is green.
  • The hidden-entries, hermes-remove, hermes-desktop-present, hermes-desktop-install, app-search, menu-guards and menu suites are green.
  • The full shell suite has 5 failures (ascii, background-instant-reload, background-intro-clone, branding-about-animation, i18n). All five fail the same way on quattro on the same worker.

Pushed c30bed75. It only changes comments. The header comments above exec_target_exists and launcher_entry_runs still said escapes are never decoded and are taken as live. That stopped being true once the decoders were added. The merge from quattro also left a stray one-line copy of the hermes_holders comment in bin/omarchy-remove-ai-hermes.

Proportionality. Fixing the two bugs takes three things:

  • Make the hermes hide depend on the package in hidden-entries.sh.
  • The presence helper and its menu guard.
  • In the remover, deleting the hermes.desktop that points into the runtime it just removed. That can match the path as a plain string, the way the wrapper loop above it already does.

The two copies of the two-layer Exec decoder (about 55 lines each in hidden-entries.sh and omarchy-remove-ai-hermes) and the scan-side guess about dead targets are beyond that. They also have edge cases of their own:

  • An executable path containing a literal " (Exec="/opt/Hermes\\"Desktop/hermes") gets cut at the escaped quote before decoding, so the scan hides a working entry.
  • -e treats a non-executable file as live.
  • Exec=/usr/bin/env /gone/hermes checks only env.

None of these is likely for an entry Hermes writes itself. Still, it is roughly 120 lines to maintain for cases nobody has reported. I'd suggest dropping the decoder in favour of the narrower remover match. Whether to take it as it stands is the maintainer's call.

Related: #13858 hides the renamed com.nousresearch.hermes entry in the same file and on the same package condition. The two don't compete, but whichever lands second will need to be adjusted for the first.

Second opinion: Codex at medium effort reviewed the head before the comment-only commit. It agreed that the decoder and the dead-target logic are more than the bug needs (its independence is not guaranteed). It found the escaped-quote case and the env and -e gaps described above. It also claimed that a CRLF entry would be judged dead and deleted. That does not hold: [[:space:]] already strips the trailing carriage return, which I checked. The renamed-ID gap it raised predates this branch and is what #13858 addresses.

@KelpME KelpME closed this by deleting the head repository Oct 26, 2026
@KelpME

KelpME commented Nov 13, 2026

Copy link
Copy Markdown
Author

Closing as stale. For the record: every finding in this thread was addressed and mutation-tested. The final review (omarchybot, c30bed75, Oct 15) was green end to end — bug reproduced and fixed on worker, full suites passing — and stated "waiting on the maintainer." No human maintainer responded at any point in the PR's 47-day life; 11 days of silence followed the final review. The work is done, not abandoned: it sits on hermes-existing-install-detect at c30bed75. #11628 remains open. If anyone at omacom wants this landed, I'll reopen on request.

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

Labels

bug Something isn't working verified Omarchy Triage has verified that this issue is ready for final review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

launcher.hides entry "hermes" removes Hermes Desktop from the launcher even when the hermes-desktop package is not installed

4 participants