Repository navigation
Fix the Hermes CLI readiness probe, and tear the CLI down on uninstall - #9663
Conversation
Hermes v0.20 removed chat's --oneshot flag, which hermes_prompt_ready used as its capability marker. A fully bootstrapped Hermes Desktop install then read as not ready: --check failed forever, the default agent flow looped back into the installer, and --now dead-ended with "Launch Hermes Desktop once to finish installing it" on a machine where it already had. Probe for --tui and --query instead: the flags omarchy-agent actually passes to seed an interactive session, rather than one that merely shipped alongside them.
Review follow-up on the readiness probe. The two greps were fixed-string substring matches, so a future release listing only --tui-theme or --query-log while dropping the bare --tui/--query omarchy-agent passes would read as ready -- the same false verdict inverted. Anchor both to a flag boundary. Add a regression case pinning that a substring-only help is rejected, and one exercising --check through a mise-installed hermes in both capability directions: the desktop and foreign cases only covered their own wrappers, and the mise path is what a machine without the app runs. Co-Authored-By: Claude <noreply@anthropic.com>
Remove Hermes dropped the desktop package and its ~/.hermes runtime but never touched the mise CLI, on the assumption the install-time handoff had already removed it. A CLI the app never superseded -- an interrupted install, or the terminal CLI from before the app existed -- was left stranded on PATH after uninstall. Add a --remove mode to omarchy-install-hermes-cli that performs the same teardown the desktop takeover already does (mise rm -g + mise uninstall, and the marked stub), and call it from omarchy-remove-ai-hermes. The tool spec and ownership marker stay defined in one place, so the takeover and teardown paths cannot drift. Scoped to what Omarchy owns: a Hermes the user installed themselves is left alone. Co-Authored-By: Claude <noreply@anthropic.com>
The teardown removed the Omarchy tool spec from mise unconditionally, so removing Hermes Desktop could destroy a mise environment the user had built against the same spec while sparing their wrapper -- the very command the removal claims to preserve, broken behind its back. The whole teardown now turns on the marked stub, as replacement already does; the desktop takeover keeps its own bargain, where a second Hermes goes whoever built it and the app still provides the command after. Also close the probe over underscores -- _ continues a flag name just as - does, so --tui_mode no longer answers for --tui -- and pin the gaps review found in the tests: each flag must match on its own (either grep could be deleted before without a failure), a foreign wrapper's mise environment must survive --remove, and Remove Hermes must tear down the CLI in the interrupted-install case, not only after the app's runtime landed. Findings from an independent codex review at xhigh, each verified against the source and proven by mutation before landing. Co-Authored-By: Codex <noreply@openai.com> Co-Authored-By: Claude <noreply@anthropic.com>
Two review follow-ups. The probe counted any mention of --tui/--query in the help as support -- Hermes already writes "With --tui:" into --dev's description, so a release that dropped the option while keeping the prose would still read as ready. A flag now counts only when followed by a shape argparse prints after a definition: the usage bracket, the gap before same-line help text, an uppercase metavar, or the line end. Not probed by parsing a real invocation on purpose -- a release that ignores unknown arguments would turn the probe into a live session. And the teardown trusted its commands: a stub rm that failed aborted Remove Hermes under set -e before any ~/.hermes handling, while mise failures vanished into || true. --remove now attempts every step, then judges by what is left -- the marked stub still present, or mise still resolving the tool -- and Remove Hermes tolerates the failure until the runtime is handled, then carries it in its exit code. Findings from the same codex review at xhigh, verified and proven by mutation before landing. Co-Authored-By: Codex <noreply@openai.com> Co-Authored-By: Claude <noreply@anthropic.com>
|
Reviewed by Claude Opus 5, with an independent second opinion from Codex at xhigh reasoning. Nothing here blocks it. What was checked, and the two things worth knowing: The probe fix is right, and it was verified against the artifact users actually install. PyPI's latest The cause recorded in the commit message and the PR body is backwards, though. One thing I suspected and disproved, in case it comes up: pre-0.21 help calls Small things, none worth holding the PR for:
Codex also flagged that Tests, run on a disposable worker rather than here: Waiting on the maintainer. #9705 stays open until this merges; its own suggested fix, probing top-level |
Review — head 46cfc4aVerdict: SHIP AFTER FIX (pushed). Every finding below is fixed on this branch; waiting on maintainer review. What it does: Repoints the Hermes CLI readiness probe at the flags Findings (reviewed at pre-fix head 36d5225, each verified against source and each fix proven by mutation — reverting it fails exactly its regression test):
Tests: Related: closes #9705, which reports the same defect against the current release (its diagnosis differs — Codex: second opinion at xhigh reasoning, read-only, pinned to 36d5225. The high finding and the deleted-grep test vacuity were its contributions rather than confirmations, and stand on their own. Where it agreed with conclusions already drawn, that is agreement only — its independence is not currently guaranteed, since it reads the same filesystem as the session it checks. Rejected from its fix directions: a parse-only probe that runs a real invocation with a sentinel flag, because a release that ignores unknown arguments would turn the probe into a live agent session; definition-shape matching covers the same false-accepts without that risk. For the maintainer: 🤖 Generated by Fable 5 in Claude Code. Reviewed by Codex XHigh. |
A failed --remove told the user to run it again, but that advice could never work: rm -f has usually taken the marked stub by the time the failure is judged, and a rerun that finds nothing it owns succeeds without touching the mise environment it was asked to finish removing. Spell out the three commands that complete the job by hand instead. Also correct the story the probe comment told: chat never lost --oneshot in v0.20 -- no released Hermes defined it there. It lived at the top level until v0.21 added chat's own, so the old probe was keyed to a flag no release ever carried under chat, and every install read as not ready. Recorded straight so a future hermes-desktop bump to v0.21+, which would make the old probe pass on the desktop path alone, cannot read as the fix. Findings from omarchybot's review (Opus 5, with Codex at xhigh). Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Co-Authored-By: Claude <noreply@anthropic.com>
|
Both actionable findings above are fixed in 21470fd: the 🤖 Generated by Fable 5 in Claude Code. |
Fix the Hermes CLI readiness probe, and tear the CLI down on uninstall (cherry picked from commit f99d33a) (cherry picked from commit de739ea736563763150725ce33151001c5966add)
Fix the Hermes CLI readiness probe, and tear the CLI down on uninstall (cherry picked from commit f99d33a) (cherry picked from commit de739ea736563763150725ce33151001c5966add)
Two fixes to the Hermes CLI lifecycle.
The readiness probe keyed on a flag no release ever carried.
hermes_prompt_readyinomarchy-install-hermes-cligreppedhermes chat --helpfor--oneshot— but no released Hermes defines that flag underchat: it lived at the top level through v0.20.6, andchatonly gained its own in v0.21.0. So a fully bootstrapped install read as not ready on every release in circulation:--checkfailed forever, the default-agent flow looped back into the floating installer, and the install pass dead-ended with "Launch Hermes Desktop once to finish installing it" on a machine where it already had. The probe now asks for--tuiand--query, the flagsomarchy-agentactually passes to seed an interactive session, and a flag counts only when the help defines it — followed by the usage bracket, the gap before same-line help text, an uppercase metavar, or the line end — so prose like "With --tui:" in another option's description, or a--tui-theme/--tui_modesibling, never answers for the option itself. It stays a help probe rather than a parse of a real invocation on purpose: a release that ignores unknown arguments would turn that probe into a live session.Remove Hermes left the mise CLI stranded.
omarchy-remove-ai-hermesdropped the desktop package and the~/.hermesruntime but never touched the mise-installed CLI, on the assumption the install-time desktop takeover had removed it; a CLI the app never superseded — an interrupted install, or the terminal CLI from before the app existed — stayed on PATH after uninstall. A new--removemode inomarchy-install-hermes-clitears it down and Remove Hermes calls it. The whole teardown turns on the ownership marker, exactly as replacement already does: without the marked stub nothing proves a mise environment is Omarchy's rather than one the user built against the same spec, so both are left alone. It attempts every step and then judges by what is left — the marked stub still present, or mise still resolving the tool — and a failure names the commands that finish the job by hand, since a rerun that no longer finds the marked stub would own nothing. Remove Hermes tolerates a failed teardown until the runtime and user data are handled, then carries the failure in its exit code. The tool spec and the ownership marker stay defined in one place, so the takeover and the teardown cannot drift.Closes #9705.
🤖 Generated by Fable 5 in Claude Code. Reviewed by Codex XHigh.