Skip to content

Add new plugins without reloading the ones already running - #18198

Merged
dhh merged 3 commits into
quattrofrom
first-run-plugin-reload
Nov 8, 2026
Merged

dhh merged 3 commits into
quattrofrom
first-run-plugin-reload

Conversation

@dhh

@dhh dhh commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

On a fresh install's first login, a few seconds in, the menu and any open panel close and the wallpaper goes black until the shell's services come back. omarchy-iso's install test caught it: "menu shortcut opens" has failed about a third of the time since #17286 (omarchy-iso#414 has the evidence).

Why

omarchy-provision-first-run runs Superwhisper's setup-user, which links its panel into ~/.config/omarchy/plugins and calls omarchy-shell shell rescanPlugins. The watcher's change and the IPC both ran reloadPlugins(). That unloads every panel and every service that isn't keepLoaded, the background included, even though the only change was a plugin nothing had loaded yet.

Fix

  • rescanPlugins no longer tears anything down. It rescans and lets the existing post-scan syncs add, update and drop plugins in place: unchanged services, panel entries and widgets stay as they are, a kept service gets its fresh manifest, and a removed plugin's service is dropped.
  • The plugin watcher still does the full reload when a plugin that's already loaded changes on disk (development hot reload). A plugin that just appeared gets the rescan.
  • A new reloadPlugins IPC keeps the full rebuild. omarchy-plugin-update uses it, because an update can change a plugin's code without touching its manifest. The plugin skill's "force a reload" advice now names it.

Tests

  • New smoke-test check. runtime-smoke-test.sh adds an ordinary service fixture with an in-memory marker. Before the existing rescanPlugins call, it adds a new plugin directory, the way Superwhisper's setup does. It then checks the new plugin is listed and the ordinary service kept its marker. On quattro that check fails ("a rescan that only adds a plugin keeps running services"); with this change it passes.
  • Existing coverage still passes. That includes "installed plugin changes reload without an explicit rescan", the hot-reload path.
  • plugins-test.sh, plugin-registry-contract-test.sh, menu-plugin-test.sh and qml-text-format-test.sh pass.

I haven't watched a real first login with this yet. The next fresh install, or omarchy-iso#414's desktop screenshots once this ships, will show it.

🤖 Generated with Claude Code

A rescan tore down every panel and every service that isn't keepLoaded,
even when all it found was a new plugin. On a fresh install's first
login, Superwhisper's setup links its panel into the plugins folder and
asks for a rescan, so a few seconds in the menu and any open panel
closed and the wallpaper went black until the services came back.

rescanPlugins now scans first and lets the syncs add what appeared. It
falls back to the full reload only when a plugin the shell already had
changed its manifest or went away. The plugin watcher still fully
reloads when a loaded plugin's files change. omarchy-plugin-update, whose
updates can keep a plugin's manifest, asks for the full reload through
a new reloadPlugins IPC.

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

greptile-apps Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

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

Summary

Separates plugin discovery from full reloads so adding a plugin can leave running services and open panels alone.

  • New plugin folders join the shell without stopping its running plugins.

Both earlier, unnumbered findings are addressed: overlapping rescans use pluginRescanPending, and the watcher matches plugin folders against __sourceDir. No new actionable issues or mounted-rule violations were found. This review used source inspection; tests were not run.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Plugin change] --> B{Known plugin folder?}
  B -->|Yes| C[Queue full reload]
  B -->|No| D[Queue rescan]
  E[Plugin update command] --> C
  F[Rescan IPC] --> D
  D --> G[Scan plugin manifests]
  G --> H[Sync services, panels and widgets in place]
  C --> I[Unload plugins and clear component cache]
  I --> G
Loading

Reviews (3) · Last reviewed commit: "Drop the manifest comparison from plugin..." · Reviewed by Greptile

Comment thread shell/shell.qml Resolved
Comment thread shell/shell.qml Resolved
dhh and others added 2 commits November 8, 2026 21:30
A rescan asked for while another scan ran was queued as a full reload,
which closed panels after all. Queue it as a rescan instead.

The plugin watcher names a plugin by its folder, but installedPlugins is
keyed by manifest id, and the two can differ (Superwhisper's
superwhisper-panel folder holds superwhisper.panel). Match the folder
against each plugin's source dir, so an edit to a loaded plugin still
takes the full reload.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The syncs after a scan already add, update and drop plugins in place, so
comparing manifests to decide on a full reload was redundant. Fresh code
still comes through the full reload, which the watcher uses for a loaded
plugin's edits and omarchy-plugin-update asks for.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dhh
dhh merged commit 60bf28e into quattro Nov 8, 2026
3 of 5 checks passed
@dhh
dhh deleted the first-run-plugin-reload branch November 8, 2026 20:59
@dhh
dhh requested a review from outfoxxed November 8, 2026 20:59
jagritvats added a commit to jagritvats/omarchy that referenced this pull request Nov 11, 2026
…eference

Since omacom#18198, rescanPlugins adds, updates and drops plugins in place, and the
full reload moved to a new reloadPlugins method. The IPC table in
docs/omarchy-shell.md still said rescanPlugins hot-reloads plugin code and had
no row for reloadPlugins.

A rescan still replaces a running plugin whose manifest changed how it loads,
so the row says that too.
omarchybot added a commit to ilyaZar/omarchy that referenced this pull request Nov 16, 2026
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>
omarchybot added a commit to hudsonwa/omarchy that referenced this pull request Nov 16, 2026
omacom#18198 made rescanPlugins add plugins without reloading the running ones and moved the forced full reload to reloadPlugins. That reload still keeps keepLoaded services (unloadPluginServices), and the keepLoaded services on quattro are still notifications, idle, media, lock and polkit, so the note about them holds unchanged beside the new command.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
omarchybot added a commit to gw7523/omarchy that referenced this pull request Nov 16, 2026
quattro reworked localPluginReloadTimer to rescan when only new plugins appeared and fully reload only when a loaded plugin changed (omacom#18198). Keep that onTriggered and carry this branch's 1000ms interval onto it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
omarchybot added a commit to Mario-Mohar/omarchy that referenced this pull request Nov 16, 2026
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>
omarchybot added a commit to thelonewander3r/omarchy that referenced this pull request Nov 16, 2026
quattro's omacom#18198 splits the watcher's timer into a full plugin reload for a plugin the shell already runs and a gentle rescan for one that just appeared. A source edit now takes the engine reload only for a loaded plugin, so a new plugin's files arriving still only add it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
omarchybot added a commit to tomasWade/omarchy that referenced this pull request Nov 17, 2026
quattro's omacom#18198 now sends a new plugin's events to a rescan and only an edit to a loaded plugin to the full reload, and reworded the per-event line to "Local plugin changed:". Keep its reload-or-rescan decision and drop the per-event line, which still prints once per inotify event, so the event path stays quiet as this pull request intends.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
omarchybot added a commit to tomasWade/omarchy that referenced this pull request Nov 17, 2026
Since omacom#18198 the watcher's timer runs a rescan, not a reload, when the plugin that changed is not loaded yet, so with the per-event line gone a new plugin appearing left nothing in the journal. Log the rescan past its pending guard, like the reload, so each one that actually starts says so once.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant