Skip to content

Keep mise tool paths ahead of system binaries in agent sessions - #18158

Open
pkordel wants to merge 1 commit into
omacom:quattrofrom
pkordel:agent-path-order
Open

pkordel wants to merge 1 commit into
omacom:quattrofrom
pkordel:agent-path-order

Conversation

@pkordel

@pkordel pkordel commented Nov 8, 2026

Copy link
Copy Markdown

What changes

Claude, Codex and Grok start through mise's command wrappers (#14233). The PATH mise hands the wrapper's child places the tool install directories after /usr/bin: mise puts them where the shims directory sits, and env-bootstrap appends the shims after the system directories so that login shells and the uwsm session never shadow /usr/bin (#6632). Inside an agent, ruby, python3, node and go therefore resolve to the Arch packages instead of the versions mise pins for the project, while npm, npx and pip, which have no system copy, still come from mise. A Claude session in a repo pinned to Ruby 4.0.9 ran bin/ scripts and hooks under the system 3.4, and node v26 ran beside mise's Node 24 npm. The terminal that launched the agent is unaffected, because the prompt hook prepends the tool directories there.

#16593 restored the shims directory "after the real install dirs so they keep precedence", but both sit behind /usr/bin.

This ships mise's activate_aggressive setting in etc/mise/conf.d/omarchy.toml, so mise keeps its tool paths in front wherever it builds a PATH, as the interactive hook already does. Command-wrapper dispatch still precedes the install directories, so account selection keeps working.

The test copies omarchy.toml into the isolated system config beside the wrapper declarations, lets the fake agent print its PATH, and asserts that the agent sees the mise tool directory ahead of /usr/bin when launched from a PATH shaped like env-bootstrap's. It fails on quattro with the install directory after /usr/bin and passes with the setting.

Verification

  • bash test/shell.d/agent-account-exec-test.sh: with only the test change, not ok - an agent sees mise tool directories ahead of /usr/bin, the printed PATH showing /usr/bin before installs/claude/1.0.0/bin; with the setting, 39 ok.
  • agent-account-test.sh (31 ok), agent-account-autoswitch-test.sh (14), agent-account-copy-test.sh (6), agent-account-recovery-test.sh (4), dev-env-path-test.sh (14), default-agent-test.sh (46), mise-dev-env-test.sh (7), mise-provision-test.sh (2), mise-agent-shims-migration-test.sh (3), preinstalls-test.sh (15): all pass.
  • On Omarchy 4.5.0 with mise 2026.11.0: a Claude session launched with MISE_ACTIVATE_AGGRESSIVE=1 claude had the mise Ruby at PATH position 2 and /usr/bin at 21, versus 15 and 11 without it. With the setting in a system-level config and the user config masked, a child of mise exec goes from /usr/bin before the tool directories to the tool directories first. In an interactive shell with the setting on, command -v claude still resolves to the command wrapper, and ruby to the pinned version.
  • Not checked: the uwsm session and SSH command PATHs. mise does not build those, so the setting does not touch them.

One thing to weigh: activate_aggressive also governs the interactive hook. Its documented effect is that mise tool paths stay ahead of PATH entries added after activation, so a user who deliberately shadows a mise tool from ~/.bashrc would notice. On this machine nothing observable changed. The narrower alternative is to reorder PATH inside omarchy-agent-account-exec only; happy to switch to that if preferred.

Screenshots

No visible change: shell PATH order only.

🤖 Generated with Claude Code

Agents start through mise's command wrappers, and mise builds the wrapper's
PATH by placing the tool directories where the shims directory sits, which
env-bootstrap puts after the system directories. Inside Claude, Codex and
Grok the system ruby, python, node and go therefore beat the versions mise
pins, while npm, npx and pip, which have no system copy, still came from
mise. Ship mise's activate_aggressive setting so its tools stay in front
wherever it builds a PATH, as the interactive hook already does.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@greptile-apps

greptile-apps Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no actionable issues were found.

Summary

Enables activate_aggressive so mise puts installed tool directories ahead of system binaries when building an agent's PATH.

  • Agent sessions now find mise-pinned tools before system binaries.

Reviews (1) · Last reviewed commit: "Keep mise tool paths ahead of system bin..." · Reviewed by Greptile

@omarchybot

Copy link
Copy Markdown
Collaborator

GPT-6 High in Codex read the diff at f8511f61b079234fd2081da53cde44f4fe745f19, the mise settings and account dispatcher, and the Bash and uwsm PATH setup. I classified this as a bug fix, but the second classifier, deepseek-v4p1-flash, returned no usable classification, so classification remains unsettled. No tests ran and no labels or code changes were applied. This waits for classification to be completed before runtime verification; the code review so far is mine alone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants