Skip to content

Respect mise selection when choosing and launching agents - #16955

Open
cobrakoral wants to merge 4 commits into
omacom:quattrofrom
cobrakoral:fix/agent-mise-selection
Open

cobrakoral wants to merge 4 commits into
omacom:quattrofrom
cobrakoral:fix/agent-mise-selection

Conversation

@cobrakoral

@cobrakoral cobrakoral commented Oct 28, 2026 •

Copy link
Copy Markdown

The agent launcher currently substitutes ~/.local/bin/<agent> whenever mise which cannot 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. With disable_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:

  • Updated regression assertions fail against unchanged quattro and pass with this change.
  • bash test/shell.d/default-agent-test.sh passes with stock mise 2026.10.19. The isolated offline checks cover fixed and locally linked versions, cold-cache latest requests 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 --install preserve the previous default and configuration on rejection or failed installation. The focused agent suite also passes at each behavior commit in this PR.
  • Account, account dispatch/recovery/copy/autoswitch, preinstalls and Remove AI suites pass; ./test/cli, Bash syntax, i18n extraction and diff checks pass.
  • ShellCheck reports the same existing diagnostics on base and patch, with none added. hermes-cli-test.sh fails identically on both because its fixture cannot find omarchy-hw-aarch64.
  • Full aggregate and graphical acceptance suites were not run.

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.

@cobrakoral
cobrakoral force-pushed the fix/agent-mise-selection branch from d849f15 to b9cef36 Compare October 28, 2026 22:58
@cobrakoral
cobrakoral force-pushed the fix/agent-mise-selection branch from 574efe5 to 9a4de98 Compare October 29, 2026 15:57
@cobrakoral
cobrakoral marked this pull request as ready for review October 29, 2026 16:07
@greptile-apps

greptile-apps Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no actionable defects were established.

Summary

Agent launches now follow PATH instead of substituting an executable from ~/.local/bin.

  • Agent launches now follow mise and PATH selection.
  • Agent choices honor configured versions and explicit opt-outs.

Acknowledged scope: cobrakoral explicitly defers the separate optimization that avoids reinstalling installed agents. cobrakoral also states that removing the local-agent exception and leaving configuration migrations out are intentional.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Choose an agent] --> B{Disabled without an external command?}
  B -->|Yes| R[Reject and keep previous default]
  B -->|No| C{Old wrapper hides an external command with no mise request?}
  C -->|Yes| R
  C -->|No| D{Unconfigured with an external command?}
  D -->|Yes| S[Save default and launch through PATH]
  D -->|No| I[Install through mise]
  I -->|Failure| R
  I -->|Success| S
Loading

Reviews (1) · Last reviewed commit: "Document native mise resolution and expl..." · Reviewed by Greptile

@cobrakoral

Copy link
Copy Markdown
Author

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, 9a4de98:

  • Agent selection checks raw mise requests, preserving configured versions even when latest cannot be resolved from a cold offline cache.
  • Launching follows PATH and native mise dispatch.
  • Explicit opt-outs require a usable external command, and rejected selections or failed installations preserve the previous default.
  • Regression coverage includes stale shims and historical Omarchy wrappers.

#17301 instead changes omarchy-agent-account-exec to avoid resolving a mise wrapper a second time, which can put system Ruby/Python ahead of the project’s selected version inside the agent.

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.

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

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants