Repository navigation
Conversation
- clear cached qml before a same id reinstall
- load updated qml in a fresh shell process
There was a problem hiding this comment.
Pull request overview
This PR fixes issue #6981, where hot-reloading a changed plugin silently re-ran stale code. The root cause is that finishPluginReload() in the shell relies on Qt.clearComponentCache, which is not exposed to QML, so rescanPlugins re-creates plugin components from Qt's URL-keyed (stale) component cache. To guarantee updated plugin code takes effect, the PR replaces the lightweight omarchy-shell shell rescanPlugins IPC call with a full omarchy-restart-shell in the update and remove commands, which starts a fresh engine with a clean component cache. Note that omarchy-plugin-add and omarchy-plugin-clone deliberately keep rescanPlugins, which is correct since they introduce brand-new plugin ids/URLs that have no cache entry to invalidate.
Changes:
omarchy-plugin-updatenow restarts the shell (instead of rescanning) after any successful update.omarchy-plugin-removenow restarts the shell (instead of rescanning) after removal, which also clears the cache so a later re-add of the same id gets fresh code.- The plugin-clone test stubs
omarchy-restart-shellso itsomarchy-plugin-removeexercise still passes.
Tip
If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.
Reviewed changes
Copilot reviewed 1 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
bin/omarchy-plugin-update |
Replaces rescanPlugins IPC with a full omarchy-restart-shell to avoid applying updates from a stale QML component cache. |
bin/omarchy-plugin-remove |
Replaces rescanPlugins IPC with omarchy-restart-shell so removals (and later re-adds of the same id) start from a clean engine. |
test/shell.d/plugin-clone-test.sh |
Adds an omarchy-restart-shell stub so the real command isn't invoked when the test exercises omarchy-plugin-remove. |
A few notes for the human reviewer to weigh: this trades a cheap in-process rescan for a full desktop-shell restart on every plugin update/remove (re-lock flow, invitation-toast re-runs, and added latency), which the author themselves flagged as a possibly-heavy approach. Behavior under set -euo pipefail is not a regression, since the previous non-quiet omarchy-shell call also aborted the script when the shell was down. The behavior-change docs (e.g. manual/32-shell-plugins.md, docs/omarchy-shell.md) still describe the old reload semantics but are outside the diff.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
maybe a note bc the clanker picked it up as well
|
|
Verified on a disposable worker VM built from the Omarchy ISO, with this branch merged into current Tests on the worker: One low-severity finding, checked on the worker and left for you and the maintainer to decide on rather than pushed. If the session is locked when the command runs (over ssh, say), Scope: this fixes the Codex at medium effort reviewed the change separately and also compared it against #8766. It recommended this PR as the interim fix while #8766 waits on quickshell, and it raised the locked-session case, which I then reproduced. It could read this session's notes, so its agreement is not guaranteed to be independent. This now waits on the maintainer. |
quattro's update now asks the shell for reloadPlugins (omacom#18198), which still cannot clear the component cache, so the conflict keeps this branch's restart. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
omarchy-restart-shell refuses while the session is securely locked, and can time out from ssh or a TTY. Under set -e that turned an already completed remove or update into a failed command, and a retried update then reports up to date. Follow omarchy-update and omarchy-update-restart: the refusal is printed, and the command reports what it did. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-Authored-By: Codex Medium <noreply@openai.com> Co-Authored-By: muse-wonder High <noreply@meta.com>
|
I also pushed one fix on top (aadf4c0) for the locked-session case from my last comment. When the session is locked (over ssh, say), Verified again on a disposable worker VM built from the Omarchy ISO, serving this branch at aadf4c0. The test plugin was a git-managed service plugin that reports its version over IPC:
Codex at medium effort and muse-wonder at high effort reviewed the ported branch. Both found the locked-session exit fixed above and nothing else. Both reviewed the fix and found nothing further. They could read this session's notes, so their agreement is not guaranteed to be independent. What is left is for the maintainer to decide:
|
[Medium impact] Plugin changes now reach the user's running Omarchy shell. The PR appears safe to merge, with non-blocking concerns around open password prompts and restart error reporting. FindingsSummaryPlugin removal and updates now restart the shell to clear stale QML.
Reviews (1) · Last reviewed commit: "Keep a refused shell restart from failin..." · Reviewed by Greptile |
| if (( UPDATED_ANY )); then | ||
| omarchy-shell shell reloadPlugins >/dev/null | ||
| # A refused restart (locked session, ssh) only prints its reason: the update is already done. | ||
| omarchy-restart-shell || true |
There was a problem hiding this comment.
Updating or removing an unrelated plugin now kills any open Polkit password prompt. omarchy.polkit uses keepLoaded, so the previous rescan/reload kept its pending request alive. A full restart destroys that request, forcing the user to retry the privileged action. Check for an active authentication request and defer the restart until it finishes.
| # A refused restart (locked session, ssh) only prints its reason: the plugin is already gone. | ||
| omarchy-restart-shell || true |
There was a problem hiding this comment.
Failed restarts report success
|| true hides every restart failure, not just a refusal before restarting. omarchy-restart-shell also returns failure after killing the old shell if its replacement never answers, or if required services fail to return. Both plugin commands then report success, so scripts can continue while the desktop shell is still down. Distinguish a refused restart from a failed restart and return failure for the latter.
refs #6981
Regarding the issue:
I can confirm the issue is real with my own plugin (plugin-control): also, on a testing machine, I had omarchy running for a couple of days and the shell wasnt restarded during that time
next, after using
omarchy plugin remove <...>plusomarchy plugin add <...>on my plugin, I couldnt get it updated, and observed the stale behavior; the plugin update did not carry over properlyRegarding its solution
Essentially, this is a question about plugin lifecycle management or so:
user could own the complete removal process as per the documentation, but then every plugin maintainer would have to add more lines to removal code in addition to the simple
omarchy plugin remove ...a follow up on shell reloads is necessary, which would duplicate to over 300 plugins or so. also many might just forget, and silent bugs being introduced all the timeintegration into existing plugin removal seems (in some form or another) advantegous; not claiming this is the best way here, but its one with fewest lines of code changes I can think of atm. ; alternatives could be to elicit code parts from shell restart into the
omarchy plugin remove ...but thats kinda duplicationnot aware of strong side effects (overkill maybe, a bit heavier than needed; not dangerous in any form) stemming from
omarchy restart shell; if so, duplication of code inomarchy plugin remove ...and change of exact behavior therein could be be better of course