Repository navigation
Let the Elsewhen migration survive a shell it cannot reach - #12853
Conversation
A bare `omarchy-shell shell rescanPlugins` exits 1 when no shell answers on the caller's tree, and omarchy-migrate runs migrations under `set -e`, so an update run from a TTY or over ssh, or one whose shell had gone down while the package replaced its QML, died at "omarchy-shell is not running" before its post-update hooks, shell restart and reboot prompt, and re-failed the same way every time until a shell could be asked. The rescan is now best-effort, like `omarchy-bar put` already is and like #11117 makes the plugin commands' closing rescan: the update restarts the shell once the migrations are through, and a session without one has no bar to place on. An unknown widget on a live shell still leaves the migration pending.
The 2026-09-19 revision of this migration, and a symlink then shipped under config/, pointed every install's ~/.config/omarchy/plugins/omacom.elsewhen at /usr/share/omarchy/plugins/omacom.elsewhen. elsewhen 1.0.0-2 moved to shell/plugins, so the link dangles, the shell lists the plugin as enabled but never loads it, and the bar carries an empty slot. The migration kept any existing link, resolving or not, so a rerun could not repair it. A link into /usr/share/omarchy that no longer resolves is Omarchy's own and is re-pointed; a link the user made is still left alone.
8b13393 to
aa5c4be
Compare
|
Reviewed and tested end to end on a disposable Omarchy worker through omabot: the branch ran only on a throwaway VM built from the ISO, and the VM was destroyed afterwards. Every log and screenshot below is in this gist, with the raw ssh transcripts beside the pictures.
Flow 1: the bug, on the base branchThe shell was stopped the way Exit 1, marker Flow 2: the fix, on this branchThe worker was dev-linked to this branch at With the shell stopped again, Exit 0, both markers written, With the shell up, the command the docs now name places the widget ( Flow 3: the stranded link from #12703With With the marker removed, Also checked there: with the marker present, Automated tests, on the worker
Each fix was broken on purpose to check the test is not vacuous: putting the bare Findings
Codex at xhigh raised the same three and found nothing else. The first was a line of attack named in its prompt, so its agreement there is not independent; the population table and the Unrelated to this PR, seen on the way: 🤖 Generated by Fable 5.1 in Claude Code. Reviewed by Codex XHigh. |







omarchy updatedies at the Elsewhen migration with "omarchy-shell is not running" and then "Something went wrong during the update!". The migration runsomarchy-shell shell rescanPluginsbare;omarchy-shellasksqs ipcfor an instance on$OMARCHY_PATH/shell, and no shell answering there is a non-zero exit.omarchy-migrateruns migrations underset -e, so that one exit ends the update before its post-update hooks, the shell restart and the reboot prompt, and the marker is never written, so every later update fails the same way until a shell can be asked.An update has no shell to ask more often than it looks: run from a TTY or over ssh, or with the shell down after the package replaced its QML, or from an environment that names a tree the running shell was not started from.
omarchy-bar putwas already written to carry on without a shell, and the keyboard-layout migration relies on that; the rescan was the one call without that tolerance, and its test asserted the opposite.Two changes, one per commit:
omarchy-shell -q shell rescanPlugins, the shape Make the closing plugin rescan best-effort #11117 gives the plugin commands' closing rescan. A shell that cannot be asked is the update's to restart afterwards, not the migration's failure to report. An unknown widget on a live shell still leaves the migration pending, and the put still fails on a shell that hangs or answers wrongly, so a misbehaving shell is not hidden; only a shell that vanishes between the two calls now reads as absent.config/, pointed every install's~/.config/omarchy/plugins/omacom.elsewhenat/usr/share/omarchy/plugins/omacom.elsewhen; elsewhen 1.0.0-2 moved toshell/plugins, so the link dangles, the shell lists the plugin as enabled but never loads it, and the bar shows an empty slot. A link into/usr/share/omarchythat no longer resolves is Omarchy's own and is re-pointed; a user's link is still left alone, resolving or not. Closes Elsewhen migration bug #12703.Related and not changed here: #12777 and @sanjyay's #12797 cover the same migration when the shell is merely busy, where
omarchy-bar putgives up on a 2s timeout it should retry, so #12797 is the companion half of this fix; #12531 and @paulogeyer's #12532 cover installs with noomarchypackage, whereomarchy-pkg-additself fails; #11115 is the same bare-rescan pattern in the plugin commands, fixed by @Mario-Mohar's #11117, with #11118 giving those commands an IPC budget. Each is a different line of this migration or a different failure of the same call. All four merge cleanly on top of this branch in any order, and the combined tree passes their tests and these.The diagnosis here stands on work in those threads. @avenkidur found the stranded link and its repair in #12703. @pedrohcmeneses traced in #12777 how one shell call under
set -etakes the whole update down and listed everything skipped afteromarchy-migrate. @TMartinPPC showed in #12531 that a failed migration re-fails every later update because its marker is never written. @Mario-Mohar's #11117 is where the best-effort-qrescan comes from, and @lancefaul's note on #9304 caught the same unguarded rescan one call earlier inomarchy plugin add.Reviewed by Codex at xhigh, read-only. It raised that a shell answering "not ready" to the quiet rescan and then dying inside the put's window would let the migration complete without placing the widget; that race is accepted, since the alternative is the update dying whenever the shell cannot be asked, and the put still fails on any live shell that misbehaves. It found nothing else against the migration change.
🤖 Generated by Fable 5.1 in Claude Code. Reviewed by Codex XHigh.