From 44b0f2a70f3735c47383ab05a98361877330ee18 Mon Sep 17 00:00:00 2001 From: Spencer Bull Date: Mon, 21 Sep 2026 20:42:26 -0500 Subject: [PATCH] Match the retired mise tool exactly in the global listing Whether the environment mise built is gone was read by searching the global listing for the prefix `"pipx:hermes-agent`, so a tool that merely starts the same way, `pipx:hermes-agent-tools` say, read as the retired one still requested. Removing the real one changed nothing, the recheck failed again, and the migration stayed pending on every update. The key is matched whole now, with or without its options. Co-Authored-By: Codex XHigh Co-Authored-By: Claude Fable 5.1 --- bin/omarchy-install-hermes-cli | 2 +- test/shell.d/hermes-cli-test.sh | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/bin/omarchy-install-hermes-cli b/bin/omarchy-install-hermes-cli index 1959757b..1fabf9be 100755 --- a/bin/omarchy-install-hermes-cli +++ b/bin/omarchy-install-hermes-cli @@ -86,7 +86,7 @@ legacy_owned() { mise_retired() { local requested requested=$(mise ls -g --json 2>/dev/null) || return 1 - ! mise where "$legacy_tool" >/dev/null 2>&1 && ! grep -qF '"pipx:hermes-agent' <<<"$requested" + ! mise where "$legacy_tool" >/dev/null 2>&1 && ! grep -qE '"pipx:hermes-agent(\[|")' <<<"$requested" } # Removes the environment the retired wrapper built, judged by what is left diff --git a/test/shell.d/hermes-cli-test.sh b/test/shell.d/hermes-cli-test.sh index 53504d5e..18ed06c1 100755 --- a/test/shell.d/hermes-cli-test.sh +++ b/test/shell.d/hermes-cli-test.sh @@ -44,6 +44,8 @@ case "$1" in ls) if [[ ${OMARCHY_TEST_MISE_BUILT:-0} == 1 && ! -e $OMARCHY_TEST_MISE_LOG.unrequested ]]; then echo '{"pipx:hermes-agent[extras=all]": [{"version": "latest"}]}' + elif [[ ${OMARCHY_TEST_MISE_SIBLING:-0} == 1 ]]; then + echo '{"pipx:hermes-agent-tools": [{"version": "latest"}]}' else echo '{}' fi @@ -261,6 +263,15 @@ run_installer --retire-mise || fail "--retire-mise succeeds with nothing of Omar [[ ! -s $mise_log ]] || fail "--retire-mise asks mise about an environment nothing proves Omarchy's" "$(cat "$mise_log")" pass "--retire-mise removes the wrapper and the environment it built, and only with proof" +# A global tool whose name merely starts the same way is not the retired one; +# read as it, it could never be removed and the migration would stay pending. +write_legacy_stub "$hermes" +: >"$mise_log" +OMARCHY_TEST_MISE_SIBLING=1 run_installer --retire-mise || fail "--retire-mise succeeds beside a tool named like the retired one" "$(cat "$test_tmp/output")" +[[ ! -e $hermes ]] || fail "the wrapper goes when only a similarly named tool is requested" +! grep -q '^mise rm' "$mise_log" || fail "a similarly named tool is taken for the retired one" "$(cat "$mise_log")" +pass "a mise tool named like the retired one does not keep the migration pending" + # The shim mise put ahead of ~/.local/bin is what the agent would run until # the environment goes; it goes with the uninstall, and so does the saved # wrapper, since once the environment is gone the proof would only keep