Repository navigation
Make the closing plugin rescan best-effort - #11117
Mario-Mohar wants to merge 3 commits into
Conversation
The four plugin commands run under `set -e` and end by asking the shell to rescan. `omarchy-shell` exits 1 when its 2s IPC timeout expires, and that is exactly what happens when the reload the command itself just triggered takes longer than two seconds. So the command dies on that line. For update and remove the work is already done at that point, so they report failure for a run that succeeded. For add and clone the abort lands before the plugin is enabled, leaving it installed but disabled with nothing printed about how to enable it. `omarchy-shell -q` exists for this and is already how ten other commands make best-effort IPC calls. It also suppresses stdout, so the `>/dev/null` goes with it. The call is still made, only its failure stops being fatal.
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.
|
Quick check-in on this one. It still merges cleanly on current quattro, and its tests and the other plugin tests pass there. The same goes for #11118. Since it went up, #12853 applied the same @spencerbull, since #12853 already builds on this, would you be up for a look? Happy to rebase, split or change anything if that makes it easier to review. |
|
Reviewed at 73fdb0f. I reproduced the bug and confirmed the fix on a disposable Omarchy worker; I found nothing to change. Reproduction. I wrote my own, separate from the PR's test. It runs the real
Tests on the worker. Read, not run. These are the only four unguarded Second opinion: none. The configured reviewer, Codex Medium, did not review this one: omabot's daily review budget was used up when this ran. Everything above is one model's review (Claude Opus 5.5) plus the worker results. Next: this is verified, but it does not get |
|
Hit this on omarchy 4.0.4-1 with |
quattro's omarchy-plugin-update now asks the shell to reloadPlugins rather than rescanPlugins (omacom#18198), so the conflict resolves to the same best-effort call on the new method: omarchy-shell -q shell reloadPlugins. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
After the merge with quattro, omarchy-plugin-update asks for reloadPlugins, so the test's exact count of four rescanPlugins calls fails, and its update case no longer reaches the failure it stubs. Rather than rework it, drop it: quattro's AGENTS.md asks that a small change get no new test file, that tests not exercise their own stub, and that tests stay in proportion to the change. The fix itself is the same -q flag on four calls, the pattern ten other commands already use for best-effort IPC. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Reviewed again at 9acc5c0. Since the last review,
The net change against Reproduction, on a disposable Omarchy worker. I ran the real
Tests on the worker. On this head, all nine Second opinion. Codex Medium and muse-wonder (thinking high) reviewed the merged tree. Both found no defect: they agreed the merge resolution keeps
Description. The PR body still describes the deleted test and says update uses Next: GitHub is holding this fork's CI runs until a maintainer approves them, so CI has not run on this head yet. Once it has run green, this waits only on a maintainer. #11118 complements this PR rather than competing with it. |
[Medium impact] This PR appears safe to merge. SummaryMakes the closing shell request best-effort in all four plugin commands.
No actionable issues found. Review was based on code inspection; no tests were run. Reviews (1) · Last reviewed commit: "Drop the stub-driven rescan test" · Reviewed by Greptile |
Fixes #11115.
The problem
All four plugin commands run under
set -euo pipefailand end by telling the shell to reload:omarchy-shell shell rescanPlugins >/dev/nullomarchy-shellwraps every call intimeout ${OMARCHY_SHELL_IPC_TIMEOUT:-2s}and exits 1 on expiry. The reload this line triggers is exactly the thing that can take longer than two seconds, so the command aborts on its own last request.>/dev/nullonly covers stdout, soomarchy-shell is not respondingstill reaches the terminal.Measured on a machine with 9 git managed plugins: a rescan with nothing to reload takes 0.05 s, one right after a real plugin update takes 1.65 s, and a second one arriving while the first is still rebuilding hits the 2 s limit. The rescan itself always completes. Only the client gives up.
What that costs depends on what follows the call:
omarchy-plugin-updateomarchy-plugin-removeomarchy-plugin-addomarchy-plugin-cloneThe exit code is not only cosmetic. #10021 and #10326 both want plugin updates to run from
omarchy update, unattended. A step that exits 1 after doing its job would report the whole system update as failed.The add and clone rows may also be the real mechanism behind #9304, which reports a plugin landing installed but disabled and attributes it to the later
enablePlugincall. With--enable --yesboth paths produce the same output, so it is worth checking which one fires there. This PR does not close that issue.The change
-qis described inomarchy-shell's own help as "Quiet best-effort mode. Suppress output and return success even when the shell, target, method, or arguments are unavailable", and it is already how ten other commands make best-effort IPC calls (omarchy-osd,omarchy-reminder,omarchy-theme-bg-set,omarchy-update-statusamong them). None of the six plugin commands used it. It also covers stdout, so the>/dev/nullgoes with it.The call is still made. Only its failure stops being fatal.
Testing
New
test/shell.d/plugin-rescan-test.sh. Itsomarchy-shellstub reproduces the real one: without-qit printsomarchy-shell is not respondingand exits 1, with-qit exits 0 silently. Six assertions covering all four commands, plus one that counts the logged rescans so best effort cannot quietly become no effort.Each of the four fixes was reverted on its own to confirm the test fails without it, and fails on the matching assertion:
./test/allbefore and after this change fails the same 6 of its test files, none of them plugin related:config,locate,runtime-smoke,screenshot-sanity,snapper,unowned-system-paths. They want anomarchy-pkgscheckout or a live compositor, neither of which this machine has. The file count goes from 236 to 237 with the new test.Also verified against the running desktop:
omarchy plugin updatewith two real plugins behind their origin exits 0 and stays quiet, where before it printed the error and exited 1.