Repair mise tools left root-owned by running 'sudo omarchy update'
Confirmed on 4.0.4-1: omarchy-update carries omarchy:requires-sudo=true, omarchy-update-mise runs MISE_MINIMUM_RELEASE_AGE=0 mise up with no privilege handling, omarchy-default-agent prints Could not set $name as the default coding agent and calls mise use -g, and the menu path setup.default.agent exists (Setup > Defaults > Agent). The sudoers manual (sudo.ws) confirms that under env_reset HOME is set from the target user, which supports the first audit's reading that only sudo -E or an env_keep reaches the user's home. /etc/sudoers and /etc/sudoers.d are not readable unprivileged, so whether this install keeps HOME is unchecked, and #13329's reporter says plain sudo omarchy update -y did write 588 files, which is why confidence stays medium. One defect: the verify runs mise use -g gh, which installs gh and adds it to the user's global mise config as a side effect of checking, and find ~ ! -user can legitimately list unrelated root-owned files (container volumes, for example). Verify rewritten to check the mise trees and run mise up, the same call the update makes.
Check the find output before a recursive chown. Only chown paths inside your own home directory.
Symptom
After running the update under sudo with your environment kept (sudo -E omarchy update, or a sudoers env_keep that keeps HOME), mise tools stop updating:
$ mise use -g opencode
mise ✗ opencode@1.18.32 3ms · failed: Permission denied (os error 13)
mise ERROR Failed to install aqua:anomalyco/opencode@latest: Permission denied (os error 13)
The header of omarchy-update says omarchy:requires-sudo=true, so the sudo looked right. The Omarchy menu under Setup > Defaults > Agent fails with Could not set <name> as the default coding agent, while already-installed agents still launch. find ~ -xdev ! -user "$USER" lists hundreds of files.
Cause
omarchy-update escalates only the steps that need root (paccache, snapper, pacman) with its own sudo calls. The per-user steps, including omarchy-update-mise, which runs MISE_MINIMUM_RELEASE_AGE=0 mise up, are meant to run as the user. When an outer sudo keeps your environment, the whole chain runs as root with your $HOME, so mise writes root-owned installs, symlinks and caches under ~/.local/share/mise and ~/.cache/mise, and later user-level mise use -g cannot replace them. With Arch's default sudo settings a plain sudo omarchy update resets HOME to /root and drops OMARCHY_PATH, so on 4.0.4-1 it aborts earlier at omarchy-update-dev: line 7: OMARCHY_PATH: unbound variable and never reaches mise. Confirmed in the 4.0.4-1 omarchy-update, omarchy-update-dev and omarchy-update-mise here.
Fix
Give your files back, then always run the update as yourself:
find ~ -xdev ! -user "$USER" | head -50 # see what root took
sudo chown -R "$USER:$(id -gn)" ~/.local/share/mise ~/.cache/mise ~/.config/mise
omarchy update # no sudo in front
If the find lists other paths (for example under ~/.cache/yay), chown those as well. The same rule holds for every omarchy-* command: they call sudo themselves where needed. If a plain sudo omarchy update stopped with OMARCHY_PATH: unbound variable instead, nothing was written to your home and only the last line applies.
Verify
find ~/.local/share/mise ~/.cache/mise ~/.config/mise -xdev ! -user "$USER" 2>/dev/null prints nothing, and mise up completes as your user without Permission denied.