Skip to content

Retire the Kimi mise wrapper the lazy-shim migration missed - #16204

Open
yamz8 wants to merge 6 commits into
omacom:quattrofrom
yamz8:fix/kimi-lazy-shim-wrapper
Open

yamz8 wants to merge 6 commits into
omacom:quattrofrom
yamz8:fix/kimi-lazy-shim-wrapper

Conversation

@yamz8

@yamz8 yamz8 commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

#9596 moved the default CLI tools from omarchy-mise-install wrappers to mise's native lazy shims, and its migration (1791382872) retires each old wrapper. Kimi's wrapper, installed by 1786967403 from #7261, isn't in its list. The two landed four days apart.

So on machines that had Kimi's wrapper, ~/.local/bin/kimi stays the old wrapper. Omarchy's own PATH puts mise's shims ahead of ~/.local/bin, so a stock login shell and the desktop session run the shim, but wherever a user's own setup puts ~/.local/bin first, the wrapper runs instead. Each run writes "npm:@moonshot-ai/kimi-code" = "latest" to the user's mise config. mise use -g copies the declaration's lazy and auto_update into that entry, so Kimi keeps both, but from then on the user's config owns Kimi rather than Omarchy's declaration, and later changes to the declaration never reach it.

A new migration handles Kimi on every machine, whether or not it has run 1791382872: it removes the wrapper only when it is exactly the one omarchy-mise-install wrote, and only then drops the latest request the wrapper wrote. A customized launcher, a symlink, or a user's own request stays untouched. Users who removed the preinstalls are skipped, since omarchy-remove-preinstalls already took the wrapper. So are users who opted out of Omarchy's mise tools by listing omarchy-tools.toml in ignored_config_paths, since the wrapper and its request are the only Kimi they have left.

Testing

  • Run against a temporary home with real mise: the exact wrapper and its latest request are removed and other tools in the config stay; a customized wrapper at the same path is kept.
  • On a real laptop, which -a kimi in a shell that had inherited ~/.local/bin ahead of the shims resolved to the old wrapper first, and the wrapper matched the template byte for byte. With this branch checked out, omarchy-migrate ran only the new migration (exit 0) and removed the wrapper. which -a kimi then found only the mise shim, the first kimi --version installed 2.3.0 on demand, and mise ls showed it managed by /etc/mise/conf.d/omarchy-tools.toml. The user's mise config was unchanged, since that wrapper had never run.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@greptile-apps

greptile-apps Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

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

Summary

Adds a migration that retires the leftover Kimi launcher only when Omarchy still declares Kimi and the launcher exactly matches the shipped wrapper.

  • Kimi now follows Omarchy’s mise declaration instead of a leftover launcher.

Reviews (5) · Last reviewed commit: "Leave Kimi alone for a user who opted ou..." · Reviewed by Greptile

Comment thread migrations/1792611438.sh Resolved
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@omarchybot omarchybot added bug Something isn't working verified Omarchy Triage has verified that this issue is ready for final review labels Oct 22, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

Reviewed by Claude Opus 5.5 and run on a disposable Omarchy worker at 5383759, with a second opinion from Codex Medium and muse-spark-1.3-contributor (pi, high).

What was checked, with real mise on the worker:

  • The worker is a stock install that had already run 1791382872, and ~/.local/bin/kimi was still there, byte-identical to what omarchy-mise-install writes today. Running it once added a "npm:@moonshot-ai/kimi-code" entry at version = "latest" to ~/.config/mise/config.toml. Re-running the base's 1791382872 touched neither, and mise ls showed the user config, not /etc/mise/conf.d/omarchy-tools.toml, governing Kimi.
  • On this head, 1792611438 removed the wrapper and the entry, mise ls then showed omarchy-tools.toml governing, kimi --version ran through the shim, and a second run did nothing. The edited 1791382872 does the same on a machine that has not run it yet. A pinned version (2.2.0) behind the wrapper stayed, and mise unuse with no Kimi entry exits 0, so a wrapper that never ran does not hold up the migration queue.
  • With either change reverted, its case in mise-lazy-tools-migration-test.sh fails. ./test/cli and that test pass on the head.

Two corrections to the description, not the code. On current quattro, default/bash/env-bootstrap appends mise's shims before ~/.local/bin, so in a stock login shell and in the desktop session the shim wins and the wrapper does not run; it only shadows the shim where someone's own setup puts ~/.local/bin first. And because the declaration exists, mise use -g copied its lazy and auto_update into the user's entry (as agents/skills/mise-tools.md notes), so Kimi kept both. The harm is that the user's config, rather than Omarchy's declaration, owns the tool, so later changes to the declaration never reach it. The fix addresses that either way.

Second opinion. Both models made the PATH point too; they can read this session's notes, so that agreement is not independent. Codex raised one finding of its own: the line added to 1791382872 puts Kimi into that migration's unconditional mise unuse -g --no-prune …@latest, so on a machine that has not run it, a Kimi entry at latest is dropped even when no Omarchy wrapper is on disk, for instance a user's own entry with auto_update = false. That is how 1791382872 already treats the other tools it lists, and it also catches a request left behind by a wrapper someone deleted by hand. 1792611438 alone would cover those machines too, but only where the wrapper is still present. Which trade to keep is the maintainer's call, so nothing was pushed. Muse's concern that mise unuse fails on a missing entry and wedges the queue did not hold on the worker.

Labelled bug and verified. Waiting on the maintainer to decide whether the 1791382872 line stays.

@chessing234 chessing234 left a comment

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.

all good

yamz8 and others added 2 commits October 27, 2026 16:03
quattro removed the migration tests (omacom#16302), so the Kimi case added to mise-lazy-tools-migration-test.sh goes with them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Migrations run strictly in filename order, and quattro has shipped migrations newer than 1792611438 since this branch was cut.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@yamz8

yamz8 commented Oct 27, 2026

Copy link
Copy Markdown
Contributor Author

Merged quattro in. #16302 removed the migration tests, so the Kimi cases went with mise-lazy-tools-migration-test.sh. The new migration is now 1793109804, after quattro's newest, since migrations run in filename order. Re-ran it against a temporary home with real mise: the wrapper and its latest request go, the rest of the config and a customized wrapper stay.

Comment thread migrations/1791382872.sh Resolved
yamz8 and others added 2 commits October 27, 2026 16:29
Listing Kimi in 1791382872 dropped its latest request whatever the launcher was, so a customized or user-owned kimi lost its own request. 1793109804 runs after it on every machine and only acts on the exact wrapper, so it handles Kimi on its own, and the shipped migration stays as it shipped.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Listing omarchy-tools.toml in ignored_config_paths opts a user out without the preinstalls-removed marker. Removing the wrapper and its latest request then left that user with no Kimi at all, so the migration now also requires the declaration to be in effect, as 1792343099 does for Node.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: muse-wonder High <noreply@meta.com>
@omarchybot

Copy link
Copy Markdown
Collaborator

Re-reviewed at the new head after the merge of quattro, by Claude Opus 5.5 and on a disposable Omarchy worker, with a second opinion from Codex Medium and muse-wonder (pi, thinking high).

What was checked, with real mise on the worker (stock install, every quattro migration through 1793565796 applied):

  • ~/.local/bin/kimi was still there, byte-identical to what omarchy-mise-install writes. Running it added a "npm:@moonshot-ai/kimi-code" entry at latest to ~/.config/mise/config.toml, and mise ls showed the user config governing Kimi. So the bug is still present on quattro today.
  • With this branch, omarchy-migrate --pending listed only 1793109804. Running it removed the wrapper and the entry, mise ls showed /etc/mise/conf.d/omarchy-tools.toml governing, kimi --version ran through the shim, and a second run did nothing.
  • Each case was run in a temporary home:
    • Removed: an exact wrapper with a latest table entry beside another tool (the other tool stays).
    • Left alone: a customized wrapper, a symlink, a pinned version (2.2.0), and an opted-out user with the preinstalls-removed marker.
    • No global config file: the migration exits 0 and removes the wrapper.
    • Unwritable config: the migration fails with the wrapper still in place, and succeeds on retry once the config is fixed.
  • ./test/cli passes.

One fix pushed, f96ad2e. If a user opts out of Omarchy's mise tools by hand, listing omarchy-tools.toml in their own miserc.toml ignored_config_paths, they have no preinstalls-removed marker. For that user, the migration deleted both the wrapper and the latest request, which were the only Kimi they had left. On the worker, mise ls then showed nothing for Kimi. The outer condition now also requires omarchy-mise-default-tools declares "$package", the same guard 1792343099 uses for Node. With it, that user keeps both, and every case above behaves as before. muse-wonder found this one, so it is credited on the commit.

Second opinion. Codex Medium noted that a stock wrapper beside a user-customized latest table would lose that table. It is left as is: the wrapper re-runs mise use -g on every launch, and 1791382872 drops every other tool's latest request the same way. muse-wonder's other points do not apply to anyone Kimi's wrapper reached:

  • Kimi's declaration shipped in the same change as 1791382872.
  • Kimi's wrapper postdates the pre---quiet templates.
  • A user with the marker and an interrupted Remove Preinstalls is a population this migration deliberately skips.

On f96ad2e both reviewers came back with nothing further. Codex can read this session's notes, so its agreement is not guaranteed to be independent.

An earlier attempt to take verified off the old head was refused, because the label was not applied by omabot. verified is now recorded against f96ad2e.

Waiting on the maintainer.

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

Labels

bug Something isn't working verified Omarchy Triage has verified that this issue is ready for final review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants