Repository navigation
Respect mise selection when choosing and launching agents - #16955
cobrakoral wants to merge 4 commits into
Conversation
d849f15 to
b9cef36
Compare
574efe5 to
9a4de98
Compare
[Medium impact] The PR appears safe to merge; no actionable defects were established. SummaryAgent launches now follow
Acknowledged scope:
|
|
Cross-reference for reviewers: #17301 addresses a separate regression reported in #17163. The two PRs currently touch different files and address different stages of launching an agent. At this PR’s current head,
#17301 instead changes The nested-session issue identified by @Jitheswar and independently reproduced by @amalrik is being discussed there. That correction belongs at the account-dispatch boundary; this PR remains focused on default-agent selection and launch. |
The agent launcher currently substitutes
~/.local/bin/<agent>whenevermise whichcannot find an installed version. That also bypasses an explicitly requested, uninstalled project version. Its command priority then changes when mise downloads the tool. The selector similarly treats a local executable as an implicit opt-out.Resolve launches through PATH and native mise dispatch throughout. The selector reads raw requested versions with offline
mise tool --requested --json, so a configured request remains authoritative even when it is uninstalled or cannot be resolved from the local cache. An explicitly disabled tool, or an existing command after removing the defaults, stays with the user's installation.For example, a project requesting an unavailable Pi version now attempts that version and fails instead of silently running
~/.local/bin/pi. Withdisable_tools = ["pi"], the external command runs even when the project version is installed. External commands elsewhere on PATH work too. When no version is configured and no external command exists, a stale native mise shim no longer suppresses installation or replaces the previous default agent.An explicitly disabled agent must resolve to an external executable before it can become the default. With no mise version configured, a surviving Omarchy wrapper ahead of an external command is rejected before changing the default or starting an installer. This recognizes historical backend names and all five shipped wrapper formats.
Related to #16881 and the explicit opt-out clarification. This removes an existing agent-specific implicit fallback. It adds no automatic fallback, PATH rearrangement, shim generation or new preference settings. It does not depend on either jdx/mise#15111 or jdx/mise#15114.
No configuration migration is needed: this changes the shipped commands and manual, leaving opt-out settings intact. Users relying on the old local-agent exception should explicitly disable the corresponding mise tool as documented.
Validation:
quattroand pass with this change.bash test/shell.d/default-agent-test.shpasses with stock mise 2026.10.19. The isolated offline checks cover fixed and locally linked versions, cold-cachelatestrequests at system/project/user scopes, explicit opt-outs with and without usable external commands, stale native shims, historical backend names, and all five shipped wrapper formats. Both normal selection and--installpreserve the previous default and configuration on rejection or failed installation. The focused agent suite also passes at each behavior commit in this PR../test/cli, Bash syntax, i18n extraction and diff checks pass.hermes-cli-test.shfails identically on both because its fixture cannot findomarchy-hw-aarch64.The selector and its test file overlap #16675, which avoids reinstalling already installed agents. That separate optimization is left out of this patch. Desktop/SSH PATH setup and account dispatch configuration are unchanged.