Skip to content

feat(mise): install default CLI tools through native lazy shims - #9596

Merged
ryanrhughes merged 20 commits into
omacom:quattrofrom
jdx:agents/mise-lazy-tools
Oct 18, 2026
Merged

ryanrhughes merged 20 commits into
omacom:quattrofrom
jdx:agents/mise-lazy-tools

Conversation

@jdx

@jdx jdx commented Sep 1, 2026 •

Copy link
Copy Markdown
Contributor

Omarchy's default CLI tools now use mise's native lazy installation instead of generated ~/.local/bin wrappers. Running codex, claude, gh, or another default still installs it on first use, but later runs execute the installed binary directly. Today's wrappers run mise use -g on every invocation, which rewrites the global mise config, can make a network request before the tool starts, and loops forever when gh is mise's GitHub credential helper (#11886).

The 20 defaults are declared together in /etc/mise/conf.d/omarchy-tools.toml, which the omarchy-settings package installs alongside the account wrappers, and appear in mise's normal tool listings. Updates come from omarchy update, or mup for mise-managed tools only. The 11 agent CLIs (codex, claude, crush, antigravity-cli, copilot, opencode, pi, oh-my-pi, grok, cursor-agent, muse) also set mise's auto_update = "4h": before one runs, mise upgrades it within latest if it has not checked in the last four hours, so a stale agent no longer misses newer models. If the update fails or the machine is offline, the installed version runs. gh is left out because mise calls it as its GitHub credential helper.

mise ls --current              # Inspect the configured tools
mise install gh               # Install one tool before first use
mise install --include-lazy   # Install all configured tools, including lazy tools

Registry shorthands replace explicit backends where appropriate, allowing mise to use cached version and release metadata and reducing GitHub API requests. Python setup now installs uv through mise, and removing the Python environment leaves uv available.

Fixes #11886.
Fixes #7234.

Adoption and overrides

Requires mise 2026.10.11 or newer. Omarchy's mise-bin already ships 2026.10.12. Before 2026.10.11, a bare mise upgrade, which omarchy update runs, installed every lazy tool nobody had run (jdx/mise#14422). In 2026.10.7 and 2026.10.8, the auto_update check a shell prompt starts did too (jdx/mise#14368). The lazy shims alone need 2026.9.4. Offline with an empty version cache, older mise looks up the lazy tools that aren't installed yet and waits on each lookup's network timeout:

mise 2026.10.6 has all of these fixes. Older versions still work, just more slowly offline.

Existing installations migrate automatically, without a password prompt. The migration waits until the updated settings package has installed the declarations, builds the new shims, and only then removes old wrappers: complete, byte-for-byte matches for known Omarchy wrapper templates, including the one the newer Grok migration writes. Customized scripts and user-owned symlinks remain untouched.

Users can disable a default in ~/.config/mise/config.toml to use their own installation on PATH:

[settings]
disable_tools = ["cursor-agent"]

Choosing a default agent installs it without adding it to the user's mise config, since the system config already declares it. The default-agent launcher also prefers user-installed Cursor and Muse commands in ~/.local/bin. The system configuration sets locked_scopes = ["project", "global"], so invocation-wide locked mode still applies to users' project and global tools while allowing Omarchy's system defaults to install. User setup also builds the Claude, Codex, and Grok account dispatchers from /etc/mise/conf.d, as before. Hermes and OpenClaw keep their own installers. Cloudflare's cf uses npm:cf with an explicit lazy shim name because the registry shorthand cf refers to Cloud Foundry.

Remove and Restore Preinstalls

The declarations are package-owned, so opting out is per user. Remove Preinstalls adds Omarchy's tools file to ignored_config_paths in ~/.config/mise/miserc.toml, so mise skips only Omarchy's declarations. The same tools declared in a project or in the user's own config keep working. Restore Preinstalls removes that line. Other users on the machine are unaffected. Users who had already removed the preinstalls are opted out the same way by the migration. After an opt-out, choosing a default agent or setting up Python adds just that tool to the user's own config. A failed shim rebuild stops restoration and leaves the opt-out marker in place.

Validation

Rebased onto current quattro.

  • The PR's shell tests pass, along with the existing mise and Hermes migration tests. default-agent-test.sh stops at an upstream Grok assertion that also fails on unmodified quattro (the migration runs unuse -y -g, the test expects unuse -g); with that expectation corrected locally, the whole file passes.
  • The opt-out helper was exercised against real mise 2026.10.3: disabling retires the shims, re-enabling one tool restores only its shim, and a user's own disable_tools entries survive the round trip.
  • The mise wrappers perform global install/config writes on every command invocation #11886 failure modes, reproduced with mise 2026.10.3 in an isolated home using this PR's /etc/mise/config.toml:
    • After first use, gh --version returns in 0.05 s and never changes the global mise config.
    • With gh auth token as mise's github.credential_command, gh starts no extra processes: mise drops its shims from the helper's PATH, and the ~/.local/bin/gh wrapper is gone.
    • For an installed tool, the shim replaces itself with the real binary, so a caller's timeout kills the tool itself and leaves nothing behind. Killing a first-use install mid-download left no processes or locks, and the next call finished the install.
    • Offline, an installed cursor-agent starts in 0.3 s once mise has cached version data. With an empty cache it waited about 42 s per call until fix(shim): skip version lookups for lazy tools that are not installed jdx/mise#14063.

The full shell suite was not completed locally, because its user-namespace probes hang in this sandbox. Desktop actions and package transactions in the shell suites are mocked. Fresh-ISO installation and the interactive Remove/Restore flow still need validation on Omarchy.

AI-assisted — Tool: Claude Code; model: anthropic/claude-opus-5-5; version: 2.1.293.

@jdx
jdx marked this pull request as draft September 1, 2026 11:49
@jdx
jdx marked this pull request as ready for review September 2, 2026 15:12
@jdx
jdx force-pushed the agents/mise-lazy-tools branch from c4d1c24 to 855a9dc Compare September 4, 2026 19:11
@jdx
jdx requested review from dhh and ryanrhughes as code owners September 4, 2026 19:11
@jdx
jdx force-pushed the agents/mise-lazy-tools branch 2 times, most recently from 5f1cadc to e9064f0 Compare September 15, 2026 02:36
@jdx
jdx force-pushed the agents/mise-lazy-tools branch from e9064f0 to 627b9b8 Compare September 21, 2026 15:45
@jdx jdx changed the title feat(mise): configure default tools as lazy feat(mise): install default CLI tools through native lazy shims Sep 21, 2026
@omarchybot omarchybot added the enhancement New feature or request label Sep 27, 2026
@greptile-apps

greptile-apps Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The latest change appears safe to merge; the remaining comment-detection issue is non-blocking.

Fix All in Claude CodeFindings

  1. P2 Comments count as active settings ▶

Summary

The PR replaces handwritten CLI wrappers with mise's native lazy shims.

  • Default command-line tools install through mise’s native lazy shims.
  • Existing installs switch from known Omarchy wrappers to native mise shims.
  • Remove and Restore Preinstalls control mise defaults for one user.
  • Agent selection and account dispatch use the shared mise tool declarations.
  • Python setup installs uv through mise and keeps it separate from Python.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[System tool declarations] --> B[Build lazy shims]
  B --> C[First command launch installs tool]
  C --> D[Later launches reuse installed tool]
  E[Remove Preinstalls] --> F[Ignore system declarations for this user]
  G[Restore Preinstalls] --> H[Remove ignore setting and rebuild shims]
Loading

Reviews (11) · Last reviewed commit: "Require mise 2026.10.11 for lazy default..." · Reviewed by Greptile

Comment thread bin/omarchy-install-dev-env Resolved
Comment thread migrations/1791382872.sh Resolved
Comment thread migrations/1791382812.sh Resolved
Comment thread manual/17-ai.md Resolved
jdx and others added 3 commits October 7, 2026 15:11
…pt-out

- Install the system config and rebuild shims before removing old
  wrappers, so a cancelled password prompt or failed reshim leaves the
  migration pending with working commands.
- Compare whole wrapper files in the shorthand migration, so a wrapper
  with an added trailing blank line is not rewritten and then deleted.
- Python setup selects uv in the user config when no system config
  declares it, as after Remove Preinstalls.
- Drop the leftover Hermes CLI instructions from the AI manual.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Omarchy's system config already declares the default agents, so choosing
one only needs `mise install`. Adding it to the user's global config
duplicated the declaration and would keep shadowing later changes to the
system defaults. After Remove Preinstalls nothing declares the agent, so
selection still adds it to the user's config.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The declarations now live in etc/mise/conf.d/omarchy-tools.toml, which
omarchy-settings installs like the account wrappers beside it. Nothing
writes /etc with sudo anymore: the migration waits for the package and
rebuilds shims, and user setup no longer installs the file.

Remove Preinstalls can't delete a package-owned file, so it now opts the
user out through mise's disable_tools. omarchy-mise-default-tools records
which entries it added so Restore Preinstalls removes only those, leaving
tools the user disabled themselves. The opt-out is per user, where it used
to change the defaults for everyone on the machine. Python setup and
default-agent selection re-enable just the tool they need.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Comment thread bin/omarchy-mise-default-tools Resolved
@imadtg

imadtg commented Oct 7, 2026

Copy link
Copy Markdown

I’ve marked #8692 as a draft in favor of this approach. Could you also add Fixes #7234 to this PR’s description? It tracks the wrapper self-resolution loop that #8692 addressed, which removing the default wrappers should also resolve.

jdx added a commit to jdx/mise that referenced this pull request Oct 7, 2026
…#14063)

Shims, `mise x`, and `mise env` resolved the version of every lazy tool
in the config, not just the command being run. For a lazy tool that
isn't installed, `latest` meant a remote version lookup, so one shim
call queried every missing lazy tool:

- **Offline with a cold version cache**, each lookup waited for its
timeout. With Omarchy's 20 lazy defaults, running an already-installed
`gh` took about 42 seconds, and the failed lookups weren't cached, so
every call stalled again until the machine was back online.
- **Online with a cold cache**, the same `gh --version` sent 26 requests
to `api.github.com`, because the offline-preferring commands skip mise's
versions host.

A lazy tool that has no installed version now keeps its requested
version (such as `latest`, a `prefix:` or `sub-N:` selector, or a
rolling channel) in those commands. Running its shim, `mise install
--include-lazy`, or `mise install <tool>` resolves and installs it as
before. Installed lazy tools still resolve to their installed versions,
and `mise ls` still shows resolved versions. Commands that manage
versions, such as `mise lock`, resolve lazy tools as before even with
`prefer_offline` set.

Measured with Omarchy's lazy tool config (omacom/omarchy#9596), an
installed `gh`, and an empty cache:

| | Before | After |
|---|---|---|
| `gh --version`, network unreachable | 42.06 s | 0.09 s |
| `gh --version`, online | 0.77 s, 30 HTTP requests | 0.09 s, 0 requests
|

## Validation

- New e2e test `test_lazy_tools_deferred_resolution`: with missing lazy
tools requesting `latest`, `prefix:0`, and `sub-1:latest` and a cold
cache, running another tool's shim, `mise x`, or `mise env` never calls
the GitHub credential command, and `mise install --include-lazy
--dry-run` still resolves `gh` to a concrete version. It fails without
this change.
- Existing lazy tool, shim, `exec`, `hook-env`, `which`, `where`, and
`current` e2e tests pass.

*AI-assisted — Tool: Claude Code; model: anthropic/claude-opus-5-5;
version: 2.1.289.*

🤖 Generated with [Claude Code](https://claude.com/claude-code)

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Medium Risk**
> Changes version resolution on hot paths (shims, exec, env) but only
when prefer_offline, lazy, and nothing is installed; install/upgrade
behavior is explicitly unchanged.
> 
> **Overview**
> **Shims**, **`mise x`**, and **`mise env`** no longer resolve every
lazy tool in config when building the toolset. Under
**`prefer_offline`**, uninstalled lazy entries keep their configured
version string (e.g. `latest`, `prefix:0`) instead of listing remote
versions, so one shim call does not time out or hit GitHub for tools
nobody invoked.
> 
> A new **`ResolveOptions.defer_missing_lazy_tools`** flag and
**`ToolsetBuilder::with_deferred_lazy_resolution()`** turn this on for
those run paths. **`mise install`**, **`upgrade`**, and **`use`** leave
the flag off so lazy tools still resolve to concrete versions when
managing installs (including **`mise install --include-lazy
--dry-run`**).
> 
> An e2e test asserts that running another tool’s shim, **`mise x`**, or
**`mise env`** never triggers the fake GitHub credential helper when
lazy tools are missing and the cache is cold.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
699497e. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Bug Fixes**
* In preferred offline mode, environment and tool-running commands can
use configured tools without triggering remote version lookups for
missing lazy tools, avoiding unnecessary credential prompts.
* Install, upgrade, and use operations continue to resolve lazy tool
versions explicitly. Dry-run installs include the requested lazy tool
version without substituting `latest`.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
Declare Kimi as a native lazy, self-updating tool alongside the other agent CLIs, and drop the handwritten-wrapper recreation test this branch replaced.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Comment thread bin/omarchy-mise-default-tools Outdated
Comment on lines +34 to +35
opted_out() {
[[ -f $miserc ]] && grep -qF "$tools_config" "$miserc"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Comments count as active settings

opted_out() treats any mention of the config path as an active opt-out. A commented-out # ignored_config_paths = ["/etc/mise/conf.d/omarchy-tools.toml"] makes Remove Preinstalls skip adding the setting and report success while the default tools remain enabled. Restore Preinstalls then refuses to continue because it sees the same comment.

Check the active ignored_config_paths value rather than searching the whole file for the path.

Fix in Claude Code

jdx and others added 2 commits October 17, 2026 03:02
Before 2026.10.11 a bare mise upgrade, which omarchy update and mup run, installs every lazy tool nobody has run yet. jdx/mise#14422 fixed that, and Omarchy's mise-bin is on 2026.10.12.
@ryanrhughes
ryanrhughes merged commit da2db1a into omacom:quattro Oct 18, 2026
1 check passed
omarchybot added a commit to calledtoconstruct/omarchy that referenced this pull request Oct 18, 2026
quattro dropped the mise.sh call from omarchy-refresh-applications (omacom#9596), at the spot where this branch adds the icon restore. Keep the restore, drop the mise.sh call, and correct the launcher test's comment, which said its fixture tree kept mise.sh from running.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
omarchybot added a commit to sebishogun/omarchy that referenced this pull request Oct 18, 2026
quattro dropped the mise.sh call from omarchy-refresh-applications (omacom#9596); keep that removal and the Ghostty desktop entry copy this branch adds.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
dhh added a commit that referenced this pull request Oct 20, 2026
Resolve the conflicts with quattro's lazy mise tools (#9596): user setup now
only builds mise's shims, and the launcher keeps both the clipboard handoff for
agents without a starting prompt and quattro's Cursor and Muse override. The
Codex collector keeps this branch's shared-module rewrite; the manual and the
agents README take quattro's wording plus this branch's agents.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
lukehsiao added a commit to lukehsiao/dotfiles that referenced this pull request Oct 23, 2026
The agents opted into `auto_update`, but mise's default 24h
`minimum_release_age` still applied to them. omp ships about once a
day, so `mise ls-remote` hid its two newest releases, and an
auto-update could only reach a release that was already a day old.
The omp install times match my `mup` alias instead, which sets the age
to 0. This patch drops the age to 0s and checks every 4h, which is how
Omarchy declares its agent CLIs. The cost is the 24h buffer against a
bad or compromised release, which `mup` already skipped.

Tested:
  Applied with chezmoi. mise reads the new options, and the hidden omp
  releases are now listed. No auto-update has fired yet because
  18.11.1 is already the latest release.

    $ mise tool github:can1357/oh-my-pi --json \
        | jaq -c '.tool_options | {auto_update, minimum_release_age}'
    {"auto_update":"4h","minimum_release_age":"0s"}
    $ mise ls-remote github:can1357/oh-my-pi | tail -1
    18.11.1

Fixes: 4f946b1 ("feat(mise): auto-update the coding agents")
Ref: omacom/omarchy#9596
Assisted-by: LLM
@emirb emirb added this to the 4.5 milestone Nov 5, 2026
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

7 participants