Repository navigation
Mise: no forced release-age 0; SSE4.2 agent skip; keep OpenClaw CLI - #11514
chessing234 wants to merge 14 commits into
Conversation
Wrappers were calling `mise use -g` on every invocation, which rewrote global mise config and raced on shared locks when a caller timed out. Pin once in omarchy-mise-install, leave wrappers as `mise x` only, and migrate existing mutating wrappers.
e4424d3 to
58daba3
Compare
Automated AI review
Outcome: Writing a wrapper now needs the network
Suggested change: Write the wrapper first and only warn if Reproducer: user setup (fails at 58daba3)install/user/mise.sh, sourced the way run_logged sources it ( Save as #!/bin/bash
set -euo pipefail
source "$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)/base-test.sh"
test_tmp=$(mktemp -d)
trap 'rm -rf "$test_tmp"' EXIT
mock_bin="$test_tmp/bin"
test_home="$test_tmp/home"
mkdir -p "$mock_bin" "$test_home"
# A first boot or ISO install with no network yet: mise answers settings
# calls, but anything that has to download a tool fails.
cat >"$mock_bin/mise" <<'SH'
#!/bin/bash
case $1 in
use | install | x | exec)
echo "mise ERROR failed to fetch versions: network unreachable" >&2
exit 1
;;
esac
exit 0
SH
# Not under test here, and it reaches pacman.
printf '#!/bin/bash\nexit 0\n' >"$mock_bin/omarchy-install-hermes-cli"
chmod +x "$mock_bin"/*
export PATH="$mock_bin:$ROOT/bin:$PATH"
export HOME="$test_home"
# Sourced exactly as run_logged does it, so a non-zero exit here aborts
# omarchy-provision-user before the default browser, the mailto handler, the
# first-install migration markers and the finalize-user marker.
status=0
bash -eE -c 'source "$1"' bash "$ROOT/install/user/mise.sh" >"$test_tmp/out" 2>&1 || status=$?
wrappers=$(find "$test_home/.local/bin" -maxdepth 1 -type f 2>/dev/null | wc -l)
(( status == 0 )) ||
fail "user setup finishes without network" "exit status $status, $wrappers wrappers written
$(cat "$test_tmp/out")"
pass "user setup finishes without network ($wrappers wrappers written)"Output at 58daba3 (PR head), exit status 1: Output at 31bd80d (merge base), exit status 0: Reproducer: migration (fails at 58daba3)migrations/1789200000.sh run the way omarchy-migrate runs it ( Save as #!/bin/bash
set -euo pipefail
source "$(dirname "${BASH_SOURCE[0]}")/base-test.sh"
migration="$ROOT/migrations/1789200000.sh"
test_dir=$(mktemp -d)
trap 'rm -rf "$test_dir"' EXIT
home="$test_dir/home"
bin_dir="$home/.local/bin"
mkdir -p "$bin_dir" "$test_dir/bin" "$test_dir/offline"
cat >"$test_dir/bin/mise" <<'SH'
#!/bin/bash
exit 0
SH
cat >"$test_dir/offline/mise" <<'SH'
#!/bin/bash
echo "mise ERROR failed to fetch versions: network unreachable" >&2
exit 1
SH
chmod +x "$test_dir/bin/mise" "$test_dir/offline/mise"
# Run the way omarchy-migrate runs it.
run_migration() {
HOME="$home" PATH="$1:$ROOT/bin:$PATH" bash -euo pipefail "$migration" >/dev/null 2>&1
}
failures=()
# The template omarchy-mise-install writes at the merge base.
cat >"$bin_dir/claude" <<'EOF'
#!/bin/bash
export MISE_MINIMUM_RELEASE_AGE=0
mise use -g --quiet "claude" || exit 1
exec mise x "claude" -- "claude" "$@"
EOF
chmod +x "$bin_dir/claude"
# 1. Rewriting a wrapper is a file edit. The earlier wrapper migrations
# (1784909971, 1787573629) did it without the network.
if ! run_migration "$test_dir/offline"; then
failures+=("migration needs the network to rewrite a wrapper (exit non-zero, so omarchy-migrate stops and omarchy update aborts)")
fi
grep -q '^mise use -g' "$bin_dir/claude" &&
failures+=("offline: the mutating claude wrapper is still in place")
# 2. Wrappers the user changed. 1787573629 leaves both alone (see
# mise-wrapper-quiet-migration-test.sh).
cat >"$bin_dir/customized" <<'EOF'
#!/bin/bash
export MISE_MINIMUM_RELEASE_AGE=0
export SOME_TOKEN=abc123
mise use -g --quiet "customized" || exit 1
exec mise x "customized" -- "customized" "$@"
EOF
cat >"$bin_dir/mismatched" <<'EOF'
#!/bin/bash
mise use -g --quiet "one-package" || exit 1
exec mise x "another-package" -- "bin" "$@"
EOF
chmod +x "$bin_dir/customized" "$bin_dir/mismatched"
customized_before=$(<"$bin_dir/customized")
mismatched_before=$(<"$bin_dir/mismatched")
run_migration "$test_dir/bin" || failures+=("migration failed with a working mise")
[[ $(<"$bin_dir/customized") == "$customized_before" ]] ||
failures+=("a generated wrapper a user added a line to is regenerated without that line")
[[ $(<"$bin_dir/mismatched") == "$mismatched_before" ]] ||
failures+=("a wrapper whose two lines disagree is rewritten to a different package")
if (( ${#failures[@]} )); then
printf -- '--- customized after migration\n%s\n--- mismatched after migration\n%s\n' \
"$(<"$bin_dir/customized")" "$(<"$bin_dir/mismatched")" >&2
for f in "${failures[@]}"; do printf 'not ok - %s\n' "$f" >&2; done
exit 1
fi
pass "migration rewrites offline and leaves wrappers it did not write alone"Output at 58daba3 (PR head), exit status 1: Remove Preinstalls misses the new wrappers
Suggested change: Also match Reproducer (fails at 58daba3)omarchy-remove-preinstalls over the cursor-agent and muse wrappers that omarchy-mise-install writes, generated the same way install/user/mise.sh generates them. Save as #!/bin/bash
set -euo pipefail
source "$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)/base-test.sh"
test_tmp=$(mktemp -d)
trap 'rm -rf "$test_tmp"' EXIT
mock_bin="$test_tmp/bin"
test_home="$test_tmp/home"
mkdir -p "$mock_bin" "$test_home"
# mise is stubbed so omarchy-mise-install can write its wrappers offline.
for command in omarchy-webapp-remove-all omarchy-tui-remove-all hyprctl omarchy-pkg-drop gum mise; do
printf '#!/bin/bash\nexit 0\n' >"$mock_bin/$command"
done
chmod +x "$mock_bin"/*
export PATH="$mock_bin:$ROOT/bin:$PATH"
export HOME="$test_home"
# The same two calls install/user/mise.sh makes.
omarchy-mise-install cursor-agent >/dev/null
omarchy-mise-install "http:muse[url=https://api.meta.ai/muse-launcher.sh,bin=muse,version_list_url=https://api.meta.ai/muse-code/channels/muse-stable,version_json_path=.version]" muse >/dev/null
omarchy-remove-preinstalls >/dev/null
left=()
[[ -e $test_home/.local/bin/cursor-agent ]] && left+=(cursor-agent)
[[ -e $test_home/.local/bin/muse ]] && left+=(muse)
if (( ${#left[@]} )); then
for name in "${left[@]}"; do
printf -- '--- ~/.local/bin/%s\n' "$name" >&2
cat "$test_home/.local/bin/$name" >&2
done
fail "Remove Preinstalls deletes the cursor-agent and muse wrappers omarchy-mise-install wrote" "left behind: ${left[*]}"
fi
pass "Remove Preinstalls deletes the cursor-agent and muse wrappers omarchy-mise-install wrote"Output at 58daba3 (PR head), exit status 1: Output at 31bd80d (merge base), exit status 0: More findingsA leftover gateway unit counts as an OpenClaw install. After the package is removed by hand, the unit file Migration rewrites wrappers it did not write. Any file of 1 KiB or less in Existing tests fail at the head. Release age reverses a documented decision. Reproducer: OpenClaw leftover unit (fails at 58daba3)OpenClaw package removed by hand (as in #11829, step 4) with no other openclaw on PATH, but the gateway unit Save as #!/bin/bash
set -euo pipefail
source "$(dirname "$0")/base-test.sh"
tmp=$(mktemp -d)
trap 'rm -rf "$tmp"' EXIT
mkdir -p "$tmp/bin" "$tmp/home/.config/systemd/user"
export HOME="$tmp/home"
unset XDG_CONFIG_HOME
# No openclaw anywhere on this PATH.
export PATH="$tmp/bin:$ROOT/bin:/usr/bin:/bin"
export TEST_LOG="$tmp/log"
: >"$TEST_LOG"
# `sudo pacman -R openclaw` by hand (issue #11829, step 4): the package is gone,
# but the unit `openclaw gateway install` wrote under ~/.config stays.
printf '[Service]\nExecStart=/usr/bin/node /usr/lib/node_modules/openclaw/dist/index.js gateway\n' \
>"$HOME/.config/systemd/user/openclaw-gateway.service"
printf '#!/bin/bash\nexit 1\n' >"$tmp/bin/omarchy-pkg-present"
printf '#!/bin/bash\nexit 1\n' >"$tmp/bin/systemctl"
printf '#!/bin/bash\nprintf "pkg-add:%%s\\n" "$*" >>"$TEST_LOG"\n' >"$tmp/bin/omarchy-pkg-add"
printf '#!/bin/bash\nprintf "agent:%%s\\n" "$*" >>"$TEST_LOG"\n' >"$tmp/bin/omarchy-agent"
printf '#!/bin/bash\nprintf "terminal:%%s\\n" "$*" >>"$TEST_LOG"\n' >"$tmp/bin/omarchy-launch-floating-terminal-with-presentation"
chmod +x "$tmp/bin"/*
type -P openclaw >/dev/null && fail "fixture: no openclaw may be on PATH"
omarchy-install-openclaw-cli --now >/dev/null 2>&1 || true
omarchy-default-agent openclaw >/dev/null 2>&1 || true
grep -q '^pkg-add:openclaw' "$TEST_LOG" ||
fail "with no openclaw installed, --now installs the package" \
"log: $(tr '\n' ' ' <"$TEST_LOG")
default agent file: $(cat "$HOME/.config/omarchy/defaults/agent" 2>/dev/null || echo none)"
pass "with no openclaw installed, --now installs the package"Output at 58daba3 (PR head), exit status 1: Output at 31bd80d (merge base), exit status 0: Reproducer: existing tests (fail at 58daba3)The repository's existing tests, unchanged, run from a checkout of the PR head (58daba3) placed at the placeholder path
At 31bd80d (merge base), exit status 0:
At 31bd80d the same file exits 0. Reproducer: migration on an incompatible CPU (fails at 58daba3)Migration 1789200000, run the way Save as #!/bin/bash
set -euo pipefail
source "$(dirname "${BASH_SOURCE[0]}")/base-test.sh"
migration="$ROOT/migrations/1789200000.sh"
test_dir=$(mktemp -d)
trap 'rm -rf "$test_dir"' EXIT
home="$test_dir/home"
bin_dir="$home/.local/bin"
mkdir -p "$bin_dir" "$test_dir/bin"
mise_log="$test_dir/mise.log"
: >"$mise_log"
# Records every call instead of downloading anything.
cat >"$test_dir/bin/mise" <<'SH'
#!/bin/bash
printf 'mise %s\n' "$*" >>"$OMARCHY_TEST_MISE_LOG"
exit 0
SH
chmod +x "$test_dir/bin/mise"
# An x86-64-v1 CPU (Core 2 Duo): SSE4.1, no SSE4.2, no POPCNT.
cpuinfo="$test_dir/cpuinfo"
printf 'processor\t: 0\nvendor_id\t: GenuineIntel\nmodel name\t: Intel(R) Core(TM)2 Duo CPU E7600 @ 3.06GHz\nflags\t\t: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx lm pni ssse3 cx16 sse4_1 lahf_lm\n' >"$cpuinfo"
if OMARCHY_CPUINFO="$cpuinfo" "$ROOT/bin/omarchy-hw-cpu-sse4_2"; then
fail "fixture: omarchy-hw-cpu-sse4_2 must reject this CPU"
fi
# The claude and pi wrappers an existing install has, in the merge-base template.
for agent in claude pi; do
printf '#!/bin/bash\nexport MISE_MINIMUM_RELEASE_AGE=0\nmise use -g --quiet "%s" || exit 1\nexec mise x "%s" -- "%s" "$@"\n' \
"$agent" "$agent" "$agent" >"$bin_dir/$agent"
chmod +x "$bin_dir/$agent"
done
# Run the way omarchy-migrate runs it.
HOME="$home" PATH="$test_dir/bin:$ROOT/bin:$PATH" OMARCHY_CPUINFO="$cpuinfo" \
OMARCHY_TEST_MISE_LOG="$mise_log" bash -euo pipefail "$migration" >/dev/null 2>&1
if grep -qE '^mise use -g( --quiet)? "?(claude|pi)"?$' "$mise_log"; then
fail "migration does not install claude or pi on a CPU omarchy-hw-cpu-sse4_2 rejects" \
"mise calls made by the migration:
$(cat "$mise_log")"
fi
pass "migration does not install claude or pi on a CPU omarchy-hw-cpu-sse4_2 rejects"Output at 58daba3 (PR head), exit status 1: Migration 1789200000 and Reproducer: omarchy-update-mise exit status (fails at 58daba3)
Save as #!/bin/bash
set -euo pipefail
source "$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)/base-test.sh"
test_tmp=$(mktemp -d)
trap 'rm -rf "$test_tmp"' EXIT
mock_bin="$test_tmp/bin"
mkdir -p "$mock_bin"
# A mise up that fails, as it does when a tool cannot be downloaded.
cat >"$mock_bin/mise" <<'SH'
#!/bin/bash
if [[ $1 == "up" ]]; then
echo "mise ERROR failed to install aqua:anthropics/claude-code: network unreachable" >&2
exit 1
fi
exit 0
SH
chmod +x "$mock_bin/mise"
export PATH="$mock_bin:$ROOT/bin:$PATH"
# omarchy update runs this under set -e, so its exit status decides whether
# the update stops here.
status=0
omarchy-update-mise >"$test_tmp/out" 2>&1 || status=$?
(( status != 0 )) ||
fail "omarchy-update-mise exits non-zero when mise up fails" "exit status $status
$(cat "$test_tmp/out")"
pass "omarchy-update-mise exits non-zero when mise up fails (exit status $status)"Output at 58daba3 (PR head), exit status 1 (terminal colour codes removed): Output at 31bd80d (merge base), exit status 0: DetailsMerge with quattro: a trial merge with the quattro tip conflicts in Open PRs that assume the old wrapper: #12329 (Remove Agents) matches only the old mutating templates, #11973's test expects a Verified:
Review informationTest scope: Source and sandbox tests with a stubbed mise, at 58daba3; no real downloads or hardware. AI process: Opus 5.5 Medium coordination and synthesis, Opus 5.5 Xhigh technical review and final fact check, GPT 6 Sol Xhigh search for related issues, Opus 5.5 Medium editorial check. Opt out: To stop receiving these reviews, reply to this comment saying so. |
[Medium impact] The PR changes default tool updates and a few AI installation choices. The earlier custom-launcher deletion issue still needs fixing before merging. Findings
SummaryThis PR lets mise honor the user's release cooldown and keeps generated wrappers exec-only.
Reviews (8) · Last reviewed commit: "Merge quattro and preserve agent CPU gua..." · Reviewed by Greptile |
| # Preserve a user-managed Muse launcher at the same path. | ||
| if [[ -f ~/.local/bin/muse && ! -L ~/.local/bin/muse ]] && | ||
| grep -Eq '^mise use -g .*"http:muse\[' ~/.local/bin/muse; then | ||
| grep -Eq '^(mise use -g .*"http:muse\[|exec mise x "http:muse\[)' ~/.local/bin/muse; then |
There was a problem hiding this comment.
Muse match deletes custom launchers
If a user-maintained Muse launcher contains a line beginning exec mise x "http:muse[, this prefix check treats it as an Omarchy preinstall and deletes the entire file. That can remove a launcher with additional user setup, despite the stated intent to preserve user-managed launchers.
Knowledge Base Used: Migration framework
|
Thanks for pulling these together. A few things on the current head:
|
Summary
Test plan