Repository navigation
feat(mise): install default CLI tools through native lazy shims - #9596
Conversation
c4d1c24 to
855a9dc
Compare
5f1cadc to
e9064f0
Compare
e9064f0 to
627b9b8
Compare
11a3e00 to
934e3cb
Compare
[Medium impact] The latest change appears safe to merge; the remaining comment-detection issue is non-blocking.
|
…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]>
…#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]>
| opted_out() { | ||
| [[ -f $miserc ]] && grep -qF "$tools_config" "$miserc" |
There was a problem hiding this comment.
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.
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
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.
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]>
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]>
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]>
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
Omarchy's default CLI tools now use mise's native lazy installation instead of generated
~/.local/binwrappers. Runningcodex,claude,gh, or another default still installs it on first use, but later runs execute the installed binary directly. Today's wrappers runmise use -gon every invocation, which rewrites the global mise config, can make a network request before the tool starts, and loops forever whenghis mise's GitHub credential helper (#11886).The 20 defaults are declared together in
/etc/mise/conf.d/omarchy-tools.toml, which theomarchy-settingspackage installs alongside the account wrappers, and appear in mise's normal tool listings. Updates come fromomarchy update, ormupfor 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'sauto_update = "4h": before one runs, mise upgrades it withinlatestif 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.ghis left out because mise calls it as its GitHub credential helper.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
uvthrough mise, and removing the Python environment leavesuvavailable.Fixes #11886.
Fixes #7234.
Adoption and overrides
Requires mise 2026.10.11 or newer. Omarchy's
mise-binalready ships 2026.10.12. Before 2026.10.11, a baremise upgrade, whichomarchy updateruns, installed every lazy tool nobody had run (jdx/mise#14422). In 2026.10.7 and 2026.10.8, theauto_updatecheck 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:auto_updatecheck before it runs resolves every lazy tool. fix(upgrade): skip remote lookups for missing lazy tools during auto_update jdx/mise#14195 (2026.10.6) fixed it, taking an offlinecursor-agent --versionfrom 41 s to 8.7 s.auto_updatethat installs a newer version, and the first launch of a lazy tool, also look up the other missing lazy tools. fix(exec): skip lazy tools that are not installed when resolving after an install jdx/mise#14197 and fix(shim): skip other missing lazy tools when a lazy tool installs on first use jdx/mise#14201 (2026.10.6) fixed both.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.tomlto use their own installation onPATH: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 setslocked_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'scfusesnpm:cfwith an explicit lazy shim name because the registry shorthandcfrefers 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_pathsin~/.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.default-agent-test.shstops at an upstream Grok assertion that also fails on unmodifiedquattro(the migration runsunuse -y -g, the test expectsunuse -g); with that expectation corrected locally, the whole file passes.disable_toolsentries survive the round trip./etc/mise/config.toml:gh --versionreturns in 0.05 s and never changes the global mise config.gh auth tokenas mise'sgithub.credential_command,ghstarts no extra processes: mise drops its shims from the helper'sPATH, and the~/.local/bin/ghwrapper is gone.cursor-agentstarts 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.