Skip to content

Let the Mise PATH cleanup finish when Mise is not installed - #16040

Open
Thelost77 wants to merge 4 commits into
omacom:quattrofrom
Thelost77:mise-work-path-without-mise
Open

Thelost77 wants to merge 4 commits into
omacom:quattrofrom
Thelost77:mise-work-path-without-mise

Conversation

@Thelost77

@Thelost77 Thelost77 commented Oct 20, 2026 •

Copy link
Copy Markdown

migrations/1789095456.sh calls mise trust --untrust without checking that mise is installed. On a machine where the user removed mise-bin, omarchy update stops with /usr/share/omarchy/migrations/1789095456.sh: line 54: mise: command not found, and every later migration stays pending. The guard in the newer 1790863209.sh (omarchy-cmd-present mise || return 0) does not help here, because this migration runs first.

Without Mise there is usually no trust to revoke. A grant can still be left in Mise's state, and it applies again once Mise is back. The cleanup now looks for a ~/Work grant in trusted-configs the same way it already looks in ignored-configs (Mise stores both as symlinks to the trusted path). With no grant, it skips the revoke, using the same omarchy-cmd-present mise || return 0 pattern as 1790863209.sh, and still removes the stock config or strips the project bin path from a custom one. With a grant, it stays pending and says to run omarchy pkg add mise-bin, as the Hermes retirement does. A MISE_STATE_DIR that starts with a literal ~/ is expanded the way Mise expands it.

Since #16302 removed the migration tests, the logic moved into a hidden command, bin/omarchy-mise-remove-work-bin-path, and the migration now just calls it. The behaviour for machines with Mise is unchanged.

test/shell.d/mise-work-path-test.sh runs the command against a PATH with no mise and covers three cases:

  • no Mise and no Work trust grant: completes and removes the stock config
  • no Mise with a grant left: stays pending, names omarchy pkg add mise-bin, and a later run with Mise revokes the grant
  • the same pending result when MISE_STATE_DIR starts with ~/

All three pass on mise 2026.11.3. Running the migration as omarchy-migrate does (bash -euo pipefail) gives the same results, and omarchy commands --check passes.

This changes the file that #12174 renames. Whichever lands second needs a rebase; the fix does not depend on the file name.

🤖 Generated with Claude Code

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

greptile-apps Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no actionable new issue was established.

Summary

Lets the Work PATH cleanup finish when Mise is absent and no matching trust grant remains.

  • The Work PATH migration can finish without Mise when no trust grant remains.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Run cleanup] --> B{Mise absent and matching grant remains?}
  B -- Yes --> C[Explain how to install Mise]
  C --> D[Leave migration pending]
  B -- No --> E[Revoke trust when needed and Mise is available]
  E --> F[Remove stock config or edit custom config]
  F --> G[Complete migration]
Loading

Reviews (3) · Last reviewed commit: "Merge upstream quattro into the Mise wor..." · Reviewed by Greptile

@omarchybot omarchybot added the bug Something isn't working label Oct 21, 2026
omarchybot and others added 2 commits October 22, 2026 00:55
Mise expands a leading ~/ in MISE_STATE_DIR, so a value set somewhere that does not expand it (an env file read without a shell) still puts trust records under the home directory. The migration took the variable literally, looked in a relative ~/ directory, found no grant, and without Mise completed while the grant survived to reapply the project bin path once Mise is back.

Co-Authored-By: Codex Medium <noreply@openai.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Codex Medium <noreply@openai.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@omarchybot omarchybot added the verified Omarchy Triage has verified that this issue is ready for final review label Oct 21, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

Reviewed and verified on an Omarchy worker VM with mise taken off PATH. On quattro, migration 1789095456.sh stops with mise: command not found. At this head it completes when no ~/Work trust grant is left, and stays pending with the install hint when one is. I checked that for a normal grant, a paranoid-mode grant (symlink plus .hash), and a rerun once mise is back, which revokes the grant. Your new test cases fail with the fix reverted and pass with it. ./test/cli and test/shell.d/mise-work-path-test.sh pass on the worker.

I pushed two commits to your branch:

  • 1fee9354d handles a MISE_STATE_DIR that starts with a literal ~/. Mise expands it, but the migration read it as written. It looked in a relative ~/ directory, found no grant, and without Mise finished while the grant survived. The grant would then put the project bin path back once Mise was reinstalled. Values set without a shell, like an env file, keep the tilde. The migration now expands a leading ~/ the same way, and a new test case covers it.
  • a1c912175 makes that test case check for the "Mise is needed to revoke its trust" message, so an unrelated failure can't make it pass.

Second opinion: Codex Medium reviewed it in three rounds. It found the ~/ case and the weak assertion, and its last round on a1c912175 found nothing open. It could read this session's notes, so its agreement elsewhere isn't fully independent. It also agreed with two things I noticed and left alone, since quattro already does both. When Mise is absent and no grant existed, the closing message still says trust "was revoked". And the exit path leaves a ~/Work the migration created itself.

As your description says, #12174 renames this file, so whichever lands second needs a rebase. This is waiting on CI for the new head, then on the maintainer.

@omarchybot omarchybot removed the verified Omarchy Triage has verified that this issue is ready for final review label Oct 21, 2026
The only conflict was test/shell.d/mise-work-path-test.sh, which quattro
deleted with the other migration suites. The cleanup now lives in
omarchy-mise-remove-work-bin-path, and the no-Mise cases test that command.

Co-authored-by: Wiktor Ziębka <Thelost77@users.noreply.github.com>
@omarchybot omarchybot added the verified Omarchy Triage has verified that this issue is ready for final review label Nov 17, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

Re-reviewed at fcc9336b1, after your merge of quattro. Moving the cleanup into the hidden bin/omarchy-mise-remove-work-bin-path is what quattro's migrations guide asks for now that migration tests are gone, and its body matches quattro's migration apart from the Mise guard and the ~/ expansion.

Verified on an Omarchy worker VM with mise taken off PATH, running the migration the way omarchy-migrate does (bash -euo pipefail). With quattro's migration (3b36b9e19) every case stops with mise: command not found, including a machine with no ~/Work at all. At this head it completes when no ~/Work trust grant is left and strips the project bin path from a custom config. It stays pending with the omarchy pkg add mise-bin hint for a normal grant, a paranoid-mode grant and a grant under a MISE_STATE_DIR of ~/.... Once mise is back, the rerun revokes the grant. With Mise installed, behaviour is unchanged. Swapping the command's body back to quattro's brings the failure back, and test/shell.d/mise-work-path-test.sh then fails on its first case. ./test/cli and that test pass at this head, and also with this head merged into current quattro. I didn't run the 3-to-4 upgrader; I read it to check it can find the new command (it puts /usr/share/omarchy/bin on PATH before running migrations).

Second opinion: Codex Medium and muse-wonder (via pi, thinking high) reviewed the new head and found nothing open. Both could read this session's notes, so their agreement isn't fully independent. Both also checked how the migration finds the command under omarchy-migrate and the upgrader, and that the exit status still keeps the migration pending.

One thing left alone, since it is only wording: with Mise absent and no grant, a custom config still gets "Mise trust for this custom config was revoked". The config isn't trusted either way.

#12174 still renames this migration. Now that the file is a single call, whichever lands second has a trivial rebase. Nothing is waiting on you. The maintainer still has to decide whether to edit the shipped migration in place (the only way to reach machines already stuck on it) and to carry the hidden command.

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