Repository navigation
Preserve custom launchers when installing mise wrappers - #11484
yashranaway wants to merge 13 commits into
Conversation
Automated AI review
Outcome: Older wrappers Omarchy generated are also backed up, as executables on PATH that migration Older generated wrappers are backed up on every template refreshThe backup condition at Suggested change: replace regular files matching the current template or the forms listed in Reproducer: generated wrapper backup (fails at 36e3372)Reproducer: refreshing a wrapper that omarchy-mise-install itself generated leaves an executable backup in ~/.local/bin Save as #!/bin/bash
set -euo pipefail
source "$(dirname "${BASH_SOURCE[0]}")/base-test.sh"
test_tmp=$(mktemp -d)
trap 'rm -rf "$test_tmp"' EXIT
export HOME="$test_tmp/home"
bin_dir="$HOME/.local/bin"
mkdir -p "$bin_dir"
# The wrapper omarchy-mise-install itself wrote before --quiet, i.e. the
# cooldown-export form that migrations/1787573629.sh regenerates.
printf '#!/bin/bash\nexport MISE_MINIMUM_RELEASE_AGE=0\nmise use -g "claude" || exit 1\nexec mise x "claude" -- "claude" "$@"\n' >"$bin_dir/claude"
chmod 755 "$bin_dir/claude"
"$ROOT/bin/omarchy-mise-install" claude
ls -l "$bin_dir" | awk 'NR > 1 { print $1, $NF }'
leftovers=$(find "$bin_dir" -name 'claude.bak.*' -print)
[[ -z $leftovers ]] ||
fail "refreshing a wrapper omarchy-mise-install generated leaves no backup on PATH" "$leftovers"
pass "refreshing a wrapper omarchy-mise-install generated leaves no backup on PATH"Actual output at the PR head (36e3372), exit status 1. Stdout: Stderr: Actual output at the merge base (28ceaae), exit status 0, stdout (stderr empty): Reproducer: backup regenerated by migration 1787573629 (fails at 36e3372)Reproducer: a saved backup is picked up by migration 1787573629 and regenerated as a live wrapper named Save as #!/bin/bash
set -euo pipefail
source "$(dirname "${BASH_SOURCE[0]}")/base-test.sh"
test_tmp=$(mktemp -d)
trap 'rm -rf "$test_tmp"' EXIT
export HOME="$test_tmp/home"
bin_dir="$HOME/.local/bin"
mkdir -p "$bin_dir"
# A wrapper as omarchy-mise-install wrote it from 2026-07-27 until migration
# 1786183928 arrived. On such a machine one `omarchy update` runs 1786183928
# (omarchy-refresh-applications -> install/user/mise.sh rewrites the wrapper by
# name) and then 1787573629, which scans ~/.local/bin/* for this same form.
printf '#!/bin/bash\nmise use -g "claude" || exit 1\nexec mise x "claude" -- "claude" "$@"\n' >"$bin_dir/claude"
chmod 755 "$bin_dir/claude"
"$ROOT/bin/omarchy-mise-install" claude
PATH="$ROOT/bin:$PATH" bash -euo pipefail "$ROOT/migrations/1787573629.sh"
find "$bin_dir" -mindepth 1 -printf '%f\n' | sort
for backup in "$bin_dir"/claude.bak.*; do
[[ -e $backup ]] || continue
grep -q -- '--quiet' "$backup" &&
fail "a saved launcher is not regenerated as a live wrapper by a later migration" "$backup: $(cat "$backup")"
done
pass "a saved launcher is not regenerated as a live wrapper by a later migration"Actual output at the PR head (36e3372), exit status 1. Stdout: Stderr: Actual output at the merge base (28ceaae), exit status 0, stdout (stderr empty): The same happens through the real runner: DetailsVerified (at 36e3372, synthetic HOME):
Optional notes:
Cross-PR: a clean merge with #10168 fails the new test at Other open PRs for this issue
Review informationTest scope: Source and sandbox tests with stubbed mise, at 36e3372; no real mise. 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. |
|
Confirmed both backup problems. Generated historical wrappers now refresh without backups, custom launchers are saved outside PATH, and the preservation and migration regressions pass. |
[High impact] The PR appears safe to merge; no outstanding finding or new actionable issue remains. SummaryThe PR preserves custom mise launchers while refreshing wrappers that match Omarchy’s generated templates. The Grok migration backs up an old generated launcher during replacement and restores it if installation fails; focused tests cover preservation, migration, and agent behavior. Reviews (8) · Last reviewed commit: "Start the Kimi removal check from an emp..." · Reviewed by Greptile |
|
Heads up on overlap: #13243 and #14539 also fix #7101 (stop |
|
Thanks for this. I reviewed it against The reason it is not that one: Codex Medium gave the second opinion on which fix should go forward. It reached the same conclusion: this pull request saves the launcher but still replaces the one the user runs. It agreed with a conclusion I had already reached, and its independence is not guaranteed. It also found two smaller problems here. A relative symlink copied into the backup directory no longer resolves from there. A generated-looking file with a NUL byte added is treated as generated and is replaced without a backup. This now waits on the maintainer, who will choose among the three fixes. |
|
I changed this in 9dd25f6. Existing launchers now stay active unless they match Omarchy's wrapper for the requested package and command. That keeps relative symlinks, package edits, and NUL-modified lookalikes intact. Installer, migration, and agent tests pass. |
The loop before it ends with the user's symlink at ~/.local/bin/kimi, which omarchy-mise-install now keeps, so the removal check was handed the user's link instead of Omarchy's wrapper. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-Authored-By: Codex Medium <noreply@openai.com>
|
I reviewed the new head against What ran. I used a harness on the worker with a throwaway
Found, at this head:
Second opinion. Codex Medium reviewed it at 1717953. Finding 3 is its own. It also confirmed 1 and 2, and the kimi fixture fix I pushed, from results I had already given it, so that part is agreement and its independence is not guaranteed. Competing fixes. We disagree on #11484 versus #13243 and #14539. Codex prefers #13243 because it handles the package switch in point 2. I would keep this one ahead, as the oldest. It is also the only one of the three that keeps a symlink at the launcher path; Claude's native installer, for example, links This now waits on the maintainer to choose between the three fixes and to decide the |
Updates leave someone's own launcher in place. Omarchy refreshes only exact wrappers it generated for the requested package and command; symlinks and edited package choices stay active. The Grok migration replaces its old generated wrapper before removing the npm tool, but keeps custom npm launchers and their tool.
Focused tests cover current and older wrappers, private permissions, symlinks, modified files, the Grok migration, and agent setup.