mise wrappers still exec-loop when mise x falls back to a PATH lookup (residual case of #6349)
Context / prior art
#6349 reported that the generated wrappers exec-loop, and #6350 fixed the
PATH-ordering case by moving the template to exec mise x "$package" -- "$bin" "$@".
@padyfec then documented a residual loop in a follow-up comment on that
(now closed) issue: when a tool's mise install dir exists but holds no binary,
mise x has no bin dir to prepend, falls back to a plain PATH lookup, finds the
wrapper in ~/.local/bin, and re-enters it forever.
That residual case doesn't appear to be tracked anywhere open, so this issue is to track it — and to add a second, distinct trigger for the same structural flaw.
What's different here
padyfec's trigger is a broken/empty install. Mine isn't: every install dir is fully populated and every tool runs correctly from an interactive shell.
$ opencode --version
1.18.18
$ mise which opencode
/home/pms/.local/share/mise/installs/opencode/latest/opencode
Yet every wrapper exec-loops when the tool is spawned by a GUI application —
in my case T3 Code (Electron), whose server sidecar shells out to
opencode --version as a provider health check.
Symptom
Not a crash, and not obviously a loop — exec keeps it inside a single PID, so
it presents as one wedged process pinning a core:
$ ps -o pid,%cpu,etime,cmd -p 2692953
PID %CPU ELAPSED CMD
2692953 42.2 12:57 /bin/bash /home/pms/.local/bin/opencode --version
That is a single opencode --version still running 13 minutes later, wchan: do_wait, continuously re-spawning mise use. Every provider in the app's UI
reported "provider status has not been checked in this session yet", because no
health check ever returned. Host accounting showed the app consuming 1h 4min of
CPU over 54min of wall clock.
Confirmation
The bin name resolves back to the wrapper rather than the installed binary:
$ mise x opencode -- sh -c 'command -v opencode'
/home/pms/.local/bin/opencode # the wrapper, not the installed binary
A depth-counted replica of the stock wrapper, run under the app's environment
with the wrapper's directory first on PATH. Note the constant PID — this is
the exec loop, not repeated forking:
depth=1 pid=3705214
depth=2 pid=3705214
depth=3 pid=3705214
depth=4 pid=3705214 <- hard stop I added; would otherwise continue
Reproduced identically with codex, claude, gh, gemini and grok — every
wrapped tool, since they share the template.
Honest scoping
I could not reduce this to a minimal repro. It reproduces reliably under the
spawning app's full environment (191 vars, captured from /proc/<pid>/environ)
with the wrapper directory first on PATH, but not in a bare env -i shell
with the same PATH ordering. So something in that environment decides whether
mise x prepends the install bin dir — consistent with both #6349's "mise PATH
hook isn't active" analysis and @padyfec's "no bin dirs to prepend" analysis.
The common factor across all three triggers is structural: the wrapper execs a
bare name that it itself shadows on PATH, so any condition that makes mise x
fall back to a PATH lookup turns into an infinite loop rather than an error.
Suggested fix
@padyfec's hardening in #6349 addresses this directly — resolve the real binary up front, exec the absolute path, and never fall back to a bare-name lookup:
BIN=$(mise which "$bin" 2>/dev/null)
[ -x "$BIN" ] || { mise install -f "$package@latest" >/dev/null 2>&1 || true; BIN=$(mise which "$bin" 2>/dev/null); }
[ -x "$BIN" ] || { echo "$command: mise package '$package' provides no executable '$bin'" >&2; exit 1; }
exec "$BIN" "$@"
If a PATH-based fallback is kept for any reason, dropping the wrapper's own directory from PATH first makes re-entry structurally impossible:
__self_dir=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)
PATH=$(printf '%s' "$PATH" | tr ':' '\n' | grep -vxF "$__self_dir" | paste -sd: -)
I'm running the mise which form locally across all 13 wrappers. Under the same
environment that previously hung forever, the checks now complete in 66–416 ms
with clean stdout.
Environment
Omarchy 4.0.0-1 · mise 2026.8.3 · opencode 1.18.18 · codex 0.147.0 · claude 2.1.233 · gh 2.97.0 · T3 Code 0.0.33 (Electron) · Linux 7.1.8-arch1-3
Confirmed independently on Omarchy 4.0.0-1 with mise 2026.8.6 (Claude Code 2.1.241, Codex CLI 0.149.0). This is not limited to T3 Code/Electron: it reproduced when a local CLI launcher inherited the interactive environment and executed claude. The stock wrapper repeatedly printed [email protected] and never reached Claude Code.
The same mise x lookup resolves differently across environments:
$ mise x claude -- sh -c 'command -v claude'
$HOME/.local/bin/claude
$ env -i HOME="$HOME" \
PATH="$HOME/.local/bin:/usr/local/bin:/usr/bin:/bin" \
mise x claude -- sh -c 'command -v claude'
$HOME/.local/share/mise/installs/claude/latest/claude
The full PATH already contained the mise install directory, but after ~/.local/bin; mise x left that ordering intact and selected the wrapper again. The same generated pattern existed in ten other wrappers on this host.
This local hardening removed re-entry and kept mise status off protocol stdout:
mise use -g "$package" >/dev/null || exit 1
bin_path="$(mise which "$bin" --tool="$package")" || exit 1
if [[ ! -x "$bin_path" ]]; then
printf '%s\n' "$command: mise package '$package' provides no executable '$bin'" >&2
exit 1
fi
exec "$bin_path" "$@"
Applied to all 12 mise-managed wrappers locally; installed Claude, Codex, and gh pass offline clean-PATH smoke tests, while the remaining lazy wrappers pass static checks without forced installation.
+1 — same loop on Omarchy 4 (quattro), mise-bin 2026.8.14, also surfaced through T3 Code probing gh (showed as "Not available on this server" while every terminal test passed).
One detail that may explain why this never reproduces interactively: it is gated on mise's shell-activation state. Same machine, same shell, same PATH:
$ mise x gh -- gh --version # works
$ env -u __MISE_DIFF mise x gh -- gh --version # loops forever
__MISE_DIFF alone flips it — removing MISE_SHELL, __MISE_EXE, __MISE_SESSION, or __MISE_ORIG_PATH individually does not. Without it, mise x falls back to a bare PATH lookup and re-execs the wrapper. GUI apps and services never carry activation state; interactive shells always do.
Workaround holding up here, as a third option next to the two proposed above: keep the mise use -g line but exec the mise shim instead of mise x:
exec "$HOME/.local/share/mise/shims/gh" "$@"
The shim's argv0 dispatch resolves the real binary in every environment.
Investigated and written by Claude Code, posted on behalf of the account owner.
Confirmed on Omarchy 4.0.4-1 with mise-bin 2026.9.9-1 and Hermes Desktop.
A Hermes Desktop Git Review / PR-badge lookup invoked:
gh repo view --json nameWithOwner -q .nameWithOwner
Hermes resolved gh to ~/.local/bin/gh, whose wrapper is:
#!/bin/bash
exec mise x "gh" -- "gh" "$@"
That command did not return. One mise x gh -- gh repo view ... process ran for about 27 minutes at ~113% CPU and accrued more than 30 minutes of CPU time. Killing it dropped package temperature from roughly 84–85°C to 62–64°C.
The actual GitHub CLI binary is healthy and returns immediately:
~/.local/share/mise/installs/gh/latest/gh_2.101.0_linux_amd64/bin/gh --version
But this reproduces the fault directly:
mise x gh -- gh --version
Within three seconds it was at ~112% CPU; it stopped only after SIGTERM. Hermes Desktop has a 30-second Node execFile timeout, but that did not reliably contain the mise child in the original incident. This matches the GUI/Electron-triggered bare-name/PATH self-resolution failure described here.
Related Hermes Desktop call path: apps/desktop/electron/git-review-ops.ts, reviewPrList().
The missing trigger is the shims dir on PATH
This issue and #7360 both flag the same gap: the loop reproduces when a GUI app spawns the wrapper, but not from a shell with ~/.local/bin ahead of installs/<tool>/…. I hit it via T3 Code 0.0.42 and reduced it to a deterministic shell repro. The variable neither report varied is ~/.local/share/mise/shims.
The loop needs all three of:
- the tool's mise install dir is on PATH, and
- the mise shims dir is on PATH, and
- the wrapper dir precedes the shims dir
Remove any one and the wrapper runs correctly. That is why ~/.local/bin ahead of installs/<tool>/latest alone — the configuration #7360 tried and discarded — never reproduces: with no shims dir on PATH, mise x resolves the tool fine.
Repro
W="$HOME/.local/bin"
S="$HOME/.local/share/mise/shims"
I="$(dirname "$(mise which claude)")"
for p in "$W:$I" "$W:$S" "$W:$I:$S" "$I:$W:$S" "$S:$W:$I" "$I:$S:$W"; do
timeout 8 env -i PATH="$p:/usr/bin" HOME="$HOME" "$W/claude" --version >/dev/null 2>&1
[ $? -eq 124 ] && echo "HANG $p" || echo "ok $p"
done
ok W:I
ok W:S
HANG W:I:S
HANG I:W:S
ok S:W:I
ok I:S:W
6/6 across repeated trials on every row — no flakiness once the three conditions are stated. Note row 4: the wrapper dir sits after the install dir and it still loops, so the determinant is position relative to shims, not to the install dir.
Why it looked app-specific
Nothing about Electron or the spawn itself is required — it is only which PATH the caller inherits.
- An interactive shell has mise's
hook-envre-prepend install dirs on every prompt, so the wrapper dir lands after the shims dir. Condition 3 fails, everything works. - A non-interactive capture —
bash -ilc 'echo $PATH', which is how T3 Code and similar apps snapshot the user's PATH — fires no prompt hook, so whatever order the rc files left stands. On my machine~/.bashrccarried a hand-addedexport PATH="$HOME/.local/bin:$PATH", putting the wrapper dir first; all three conditions met and every provider probe hung until its timeout.
This also subsumes the two triggers already reported here: padyfec's empty-install-dir case drops condition 1 by a different route, and the "only under a GUI app" case is just condition 3 arriving via a prompt-less PATH.
Symptom, for searchability
Every spawned CLI hits its caller's timeout exactly. In T3 Code 0.0.42: claude 4006ms/4000, codex 10004ms/10000, gh 5002ms/5000, providers stuck at status=error / "installed but failed to run. Timed out while running command." One /bin/bash ~/.local/bin/<tool> at do_wait, constant PID, as described above.
Scoping honestly: the above is the external condition, verified empirically. I did not chase why mise x stops resolving the tool itself once the shims dir is on PATH — that is mise-internal and may deserve a report there as well.
Re: the fix
Consistent with the shape in #8692 — resolving the binary up front and exec'ing an absolute path makes all three conditions moot. Until that lands, the workaround is to keep the shims dir ahead of ~/.local/bin; on Omarchy that is exactly what default/bash/env-bootstrap achieves by appending ~/.local/bin, and a hand-added prepend in ~/.bashrc defeats it.
Environment: Omarchy 4.0.0.alpha · mise 2026.9.9 · bash 5.3.15 · Linux 7.2.6-arch2 · claude 2.1.274 · codex 0.154.0 · gh 2.101.0 · T3 Code 0.0.42 (Electron)
Independent confirmation from a third Electron host (Hermes Desktop), plus two new data points: a stale __MISE_DIFF acting as the switch, and orphaned loopers surviving 9h with no spawner left to reap them.
Setup: Omarchy 4.0.4, mise 2026.9.12, stock omarchy-mise-install wrappers, ~/.bashrc with NO hand-added PATH lines (only the Omarchy rc). Three gh auth status spawned by Hermes Desktop (Electron, .desktop launch) at 00:59–01:03, orphaned to systemd --user when Hermes restarted itself for an update at 01:02. Found at 10:20 still looping: TIME ~4h / ELAPSED ~9.3h each, at 100% CPU each.
Same-PID exec loop confirmed: each PID alternated exe=bash / VSZ 8KB / 1 thread ↔ exe=mise / VSZ ~1.1GB / 17 threads between 0.2s polls, constantly re-spawning short-lived mise use -g --quiet gh children (~2500 forks/sec across the three). mise x execs without forking (verified: mise x gh -- bash -c 'echo $$' prints the parent PID), so a PATH-fallback resolution of the bare bin name is a same-PID bash -> mise x -> bash loop.
New: stale __MISE_DIFF is the switch. The wedged env had ~/.local/bin first (satisfying the three-condition trigger from the previous comment), but additionally: the identical PATH without the inherited __MISE_DIFF completes in ~0.5s (exit 0), while with the stale __MISE_DIFF, MISE_DEBUG=1 mise x gh -- gh auth status re-enters the wrapper indefinitely (dozens of re-invocations in 3s). So on top of PATH order, mise's own cached diff state decides whether mise x resolves the tool itself or falls back to the PATH lookup that finds the wrapper.
Forensic marker: the wedged bash processes carried __MISE_TASK_TOOL_ARGS=[{"backend":"gh",...}] — i.e. they were spawned by mise x gh, proving the recursion direction without needing to catch the exec in flight.
Orphan angle: the 30s execFile-style caller timeout did not contain these — the Desktop restarted, the loopers reparented to systemd, and nothing reaped them for 9h. Worth considering, alongside fixing resolution, that a spawner-side timeout doesn't help once the spawner itself is gone.
Workaround (verified against the exact stuck env): strip the wrapper dir from PATH before mise x in the wrapper; the stuck PATH+DIFF combo then completes at once. Applied locally to all 15 wrappers as scaffolding until the template is fixed.
Environment: Omarchy 4.0.4 · mise 2026.9.12 · bash 5.3.15 · gh 2.101.0 · Hermes Desktop (Electron).
Some additional context on how the problematic PATH ordering can arise without manually customizing it: I compared an affected machine with a fresh Omarchy installation. Both had the same vulnerable gh wrapper and identical T3 launchers, but the fresh machine resolved gh directly to the mise-installed binary.
The affected machine had this in its shell startup files:
# uv
export PATH="/home/imad/.local/share/../bin:$PATH"
That path is equivalent to ~/.local/[bin](https://github.com/home/imad/.local/bin), so it overrides Omarchy’s default of appending the wrapper directory after mise’s shims. There was also a separate installer-added ~/.local/[bin](https://github.com/home/imad/.local/bin) prepend. The uv fragment is consistent with its installer, which Omarchy’s Python development setup invokes, although I couldn’t establish the exact historical invocation.
Removing those prepends restored working gh execution. The T3 service also needed its inherited environment refreshed; restarting it alone retained the old PATH.
This explains why an otherwise working fresh installation can develop the issue later. It’s one route into the failure, alongside the activation-state cases above—not a claim that PATH order alone always triggers it. Resolving an absolute executable in the wrapper remains the robust fix.
Fourth spawner: VS Code's Copilot agent host (copilot --acp --stdio)
Hit this on Omarchy 4.0.4 / mise 2026.9.14. VS Code's Copilot agent host spawned ~/.local/bin/copilot --acp --stdio via a transient systemd scope; the wrapper exec-looped (bash ↔ mise x, constant PID, ~2500 mise use forks/min, 38% CPU). The spawning scope died 7s later, the looper reparented to systemd --user, and survived ~2h45m with 63min CPU time accrued until killed manually — same orphan shape krsna1729 described.
Same fix shape as #8692 applies (mise which → exec absolute path); verified stable locally across all 15 wrappers.
Independent confirmation on October 7, 2026 with mise 2026.10.0, Codex CLI 0.160.1, and T3 Code 0.0.45-1 from the Omarchy repository. The current packaged wrapper still uses the bare-name mise x form, and the PATH/shims condition reported above reproduces on this machine.
User-visible failure
On desktop startup, T3 reports:
Codex provider status
Timed out while checking Codex app-server provider status.
The installed ~/.local/bin/codex wrapper, matching the template in omarchy-mise-install, is:
#!/bin/bash
export MISE_MINIMUM_RELEASE_AGE=0
mise use -g --quiet "codex" || exit 1
exec mise x "codex" -- "codex" "$@"
Using the affected T3 backend's environment captured from /proc/<pid>/environ, the wrapper's --version did not finish within an 8-second bound. The actual installed Codex executable returned codex-cli 0.160.1 in approximately 0.02 seconds. T3 traces recorded a 10-second provider probe timeout and a 20-second workspace skills probe timeout.
Reduced PATH lookup reproduction
This lookup does not invoke the wrapper, so it demonstrates self-resolution without starting the loop:
W="$HOME/.local/bin"
I="$HOME/.local/share/mise/installs/codex/latest/bin"
S="$HOME/.local/share/mise/shims"
env -i HOME="$HOME" PATH="$W:$I:$S:/usr/bin" \
/usr/bin/mise x codex -- /usr/bin/bash -c 'command -v codex'
# $HOME/.local/bin/codex (the wrapper)
env -i HOME="$HOME" PATH="$S:$W:$I:/usr/bin" \
/usr/bin/mise x codex -- /usr/bin/bash -c 'command -v codex'
# $HOME/.local/share/mise/installs/codex/latest/bin/codex (the executable)
Both lookups were run locally and returned the paths shown. Explicitly invoking "$W/codex" --version under the first minimal environment also timed out after 3 seconds; the test's entire process group was then terminated. Normal interactive tests and tests using a different inherited environment can succeed, so a successful terminal version check alone does not rule this out.
Verified workaround
Setting T3's Codex Binary path to:
~/.local/share/mise/installs/codex/latest/bin/codex
(using the expanded absolute path) bypassed the wrapper. In the same affected backend environment, direct app-server probes succeeded: initialize ~0.049 s, account/read ~0.617 s, skills/list ~0.012 s, model/list ~0.001 s, and account/rateLimits/read ~1.362 s. After restarting T3, its provider cache reported status: ready, auth.status: authenticated, and version 0.160.1.
This is additional evidence for the existing wrapper-resolution issue, not a test of PR #9175 and not proof of a separate mise-internal defect. The quiet flag is already present here, so this failure is distinct from stdout pollution in #6908.
Environment
- Omarchy package:
omarchy-dev 4.0.0.r6720.g8e02fc8-1 - mise package:
mise-bin 2026.10.0-1 - T3 package:
t3code-bin 0.0.45-1 - Codex CLI:
0.160.1(mise-managed) - Kernel:
7.2.5-4-omarchy, x86_64 - Desktop: Hyprland / Wayland
- CPU: Intel Core i5-13600KF; GPU: NVIDIA GeForce RTX 5060
omarchy debug --no-sudo --print is unavailable in this installed build (Unknown Omarchy command), so the details above were collected directly. No raw process environment or authentication data is included.
Reproduced on a clean Omarchy worker against current quattro (902fd8aeb), with the wrapper regenerated by quattro's bin/omarchy-mise-install, mise 2026.9.11 and gh 2.102.0. Running ~/.local/bin/gh --version under env -i with different orderings of the wrapper dir (W), the mise shims dir (S) and gh's install dir (I):
ok W:I
ok W:S
HANG W:I:S
HANG I:W:S
ok S:W:I
ok I:S:W
Under W:I:S, mise x gh -- bash -c 'command -v gh' returns ~/.local/bin/gh, the wrapper itself, while under S:W:I it returns the installed binary. That matches the matrix @kazeshini178 posted. The stock session PATH on the worker (shims before ~/.local/bin) works, so the trigger is something putting ~/.local/bin ahead of the shims dir, such as an installer's or rc file's prepend. The cause is in the template: bin/omarchy-mise-install:56 writes exec mise x "<package>" -- "<bin>", so the wrapper runs a bare name that it shadows on PATH. Nothing on quattro changes this yet, and no migration rewrites existing wrappers away from it. Under both orderings that hang, mise which --tool gh gh still resolves the real binary, so resolving an absolute path first avoids the loop.
Several open pull requests change this template: #8692 (draft, linked to this issue), #13614 and #13769 resolve an absolute path and exit if that fails. #9175 does the same without a fallback and currently conflicts. #9583 resolves first but still falls back to the bare name when resolution fails. #13470 adds a re-entry guard instead. #9596 replaces the wrappers with mise's native lazy shims. Each of these pull requests is reviewed separately, and choosing between them is the maintainer's call.
Second opinion: Codex Medium agreed that quattro still writes the bare-name exec and that no commit or migration fixes it. It also pointed out that #9583 keeps the bare-name fallback, and that the default PATH order avoids this trigger without structurally preventing the wrapper from resolving to itself. Its agreement was not independent of this review.
This now waits on the maintainer to choose a fix.
Independent confirmation on Omarchy 4.0.4-1 / mise 2026.10.5, with CodexBar as the background probe consumer.
System details
Omarchy 4.0.4-1 on x86_64, AMD Ryzen 7 PRO 8840HS / Radeon 780M. mise 2026.10.5; native Claude Code 2.1.296. Observed on 2026-10-10.
What's wrong?
The Omarchy-generated ~/.local/bin/claude wrapper resolves itself again through mise x, causing repeated launcher execution and sustained CPU consumption instead of invoking the installed Claude executable.
This was discovered while investigating a background claude auth status probe launched from CodexBar's ClaudeProbe working directory. The process survived its parent and ran for 18 minutes 34 seconds, accumulating 7 minutes 53 seconds of CPU time. A three-second sample measured approximately 41.6% of one CPU core. It alternated between a bash launcher and mise. It was stopped manually.
The CodexBar widget also has a watchdog that sends SIGKILL to the CodexBar parent; this may explain how the probe survived, but the observed launcher self-resolution can be demonstrated independently of CodexBar. The exact orphaning sequence was not captured.
Installed wrapper
#!/bin/bash
export MISE_MINIMUM_RELEASE_AGE=0
mise use -g --quiet "claude" || exit 1
exec mise x "claude" -- "claude" "$@"
The installed omarchy-mise-install script generates this same wrapper structure. An older migration (1784909971.sh) explicitly mentions preventing wrappers from recursing through PATH, but the current wrapper still self-resolves in this environment.
Safe reproduction / evidence
Without executing the recursive wrapper:
$ mise which claude
/home/<user>/.local/share/mise/installs/claude/latest/claude
$ mise x claude -- which claude
/home/<user>/.local/bin/claude
$ ~/.local/share/mise/installs/claude/2.1.296/claude --version
2.1.296 (Claude Code)
The Claude-related entries from mise env claude --json retain this ordering:
/home/<user>/.local/bin
/home/<user>/.local/share/mise/installs/claude/latest
Thus exec mise x "claude" -- "claude" "$@" finds the same launcher again. The installed native Claude executable itself returns its version promptly.
Expected
The launcher should invoke the installed Claude executable reliably, even when ~/.local/bin precedes the active installation in PATH. A passive background auth/version probe should not enter a launcher loop or repeatedly run installation/version resolution.
Actual
The wrapper resolves back to itself and can consume sustained CPU until manually killed. One possible fix direction is to resolve the executable with mise which and invoke the resolved absolute path, or otherwise ensure that the wrapper cannot be selected again. This is a proposed direction, not a tested patch.
No credentials, tokens, or full environment dumps are included.
I am preparing a wrapper resolution fix with regression coverage and migration of existing generated wrappers.