Skip to content

Give plugin enable longer than 2s to reach a reloading shell - #14710

Open
omarchybot wants to merge 1 commit into
quattrofrom
fix/issue-9304
Open

omarchybot wants to merge 1 commit into
quattrofrom
fix/issue-9304

Conversation

@omarchybot

Copy link
Copy Markdown
Collaborator

omarchy plugin add <url> --enable can install a plugin and then fail the enable with omarchy-shell is not responding, exiting 1. The shell is only busy, not hung.

Adding a plugin sets off two full plugin reloads: one from the explicit rescanPlugins, and one from the plugins directory watcher, 150ms after the mv (shell/shell.qml, localPluginReloadTimer). Whichever arrives second while the first is running is kept as pending and runs as soon as the first scan finishes (reloadPlugins and onScanFinished). The discovery poll in omarchy-plugin-add sees the new id after the first reload, so the one enablePlugin call arrives while the second reload is unloading and recreating every panel, service and bar widget. On a bar with many plugins that rebuild takes longer than omarchy-shell's 2s default, and the call times out. The same can happen to a bare omarchy plugin enable run straight after a write under ~/.config/omarchy/plugins/.

omarchy-plugin-enable now gives its enablePlugin call up to 10s, unless OMARCHY_SHELL_IPC_TIMEOUT is set explicitly. That covers plugin add --enable, plugin clone and a bare plugin enable. It waits longer and does not retry: omarchy-shell reports a timed-out call rather than resending it, because the shell may already be running it. A shell that is really hung now takes 10s rather than 2s to report as not responding.

This does not fix the other way #9304 happens, where the rescanPlugins call before discovery times out and set -e stops plugin add before it tries to enable. #11117 makes that rescan best-effort. Between the two, plugin add --enable finishes the enable instead of leaving the plugin installed but disabled.

A worker on the Omarchy ISO ran a throwaway shell from this tree, with a test plugin that keeps the event loop busy for 3.5s on each reload. omarchy plugin enable sent 0.3s after a reload failed at 2.0s on quattro in 3 runs out of 3, and succeeded at 3.5–3.6s with this change in 5 runs out of 5. Codex Medium reviewed the mechanism and the change and found no defect. The code comment and test name here take its wording corrections.

Fixes #9304

Adding a plugin sets off two full reloads, one from the rescan and one from the file watcher, and a plugin add --enable discovers the plugin between them, so its one enablePlugin call lands in the second. On a bar with many plugins that rebuild holds the shell past omarchy-shell's 2s default, and the enable reports the shell as not responding and exits 1, though the shell is only busy. Wait up to 10s for this call, unless a timeout is set explicitly.

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

greptile-apps Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[Medium impact] This PR appears safe to merge.

Summary

omarchy-plugin-enable now waits up to 10 seconds for enablePlugin, unless a nonempty OMARCHY_SHELL_IPC_TIMEOUT is supplied.

  • Other shell calls retain their existing timeout.
  • Tests check the new default and preserve an explicit override.
  • No actionable issues found. Tests were inspected, not run.

Reviews (1) · Last reviewed commit: "Give plugin enable longer than 2s to rea..." · Reviewed by Greptile

@jandrusk

Copy link
Copy Markdown

This looks right to me: omarchy-shell honors OMARCHY_SHELL_IPC_TIMEOUT on both the socket and qs ipc paths, and an explicit value still wins.

It should also cover #14429 (same "omarchy-shell is not responding" on plugin add --enable, just with many plugins installed making the reload slower), so that one can probably be closed along with #9304 when this lands.

@omarchybot

Copy link
Copy Markdown
Collaborator Author

Queue pass on a364187: this one is not reviewed yet. Classifying a pull request needs two models to agree, and the second, Codex Medium, did not run, because omabot's review budget for today was already spent. Claude Opus 5.5 read the diff and called it a bug fix, but one model's call does not set a label. So there is no class label, and nothing was run on a worker or verified this pass. Next step: the queue takes it round again once the second opinion is available.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants