Skip to content

Retry omarchy-bar put when omarchy-shell times out while busy - #12797

Closed
sanjyay wants to merge 1 commit into
omacom:quattrofrom
sanjyay:fix/issue-12777-bar-put-timeout
Closed

sanjyay wants to merge 1 commit into
omacom:quattrofrom
sanjyay:fix/issue-12777-bar-put-timeout

Conversation

@sanjyay

@sanjyay sanjyay commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

Problem

During omarchy update (or when running migrations like migrations/1789581661.sh), migrations call omarchy-shell shell rescanPlugins right before omarchy-bar put .... While the shell is rebuilding plugins and panels, IPC calls may exceed OMARCHY_SHELL_IPC_TIMEOUT (2s), causing omarchy-shell to exit with status 124 and print omarchy-shell is not responding.

In bin/omarchy-bar:ask_to_put, the retry loop checks for *"not ready"* and *"is not running"*, but falls straight through to the fatal else branch upon receiving "omarchy-shell is not responding". Because migrations execute under set -euo pipefail, this aborts on the very first timeout and terminates the entire system update with pending migrations stranded.

Root cause and fix

Treat *"is not responding"* as a retriable condition alongside *"not ready"* in ask_to_put, recording SHELL_ANSWERED=1 so omarchy-bar waits out the busy shell during reload/rebuild rather than failing on the first timeout.

Fixes #12777.

Verification

Tested in a disposable OMAVM guest (Omarchy 4.0.3-1, Hyprland 0.56.2, Quickshell 0.3.1) from the clean fresh snapshot:

  • Added unit test coverage for the busy / timeout state in test/shell.d/bar-test.sh. Tested inside OMAVM: all 81 assertions passed.
  • Ran ./test/cli inside OMAVM: passed cleanly.
  • Ran test/shell.d/elsewhen-default-migration-test.sh inside OMAVM: all assertions passed.
  • Tested live widget placement against the running desktop shell in OMAVM (omarchy-bar put omarchy.keyboard-layout --after omarchy.clock), verifying successful placement on the bar.
  • Captured screenshot in OMAVM (omavm shot) verifying desktop and bar stability.
  • Host machine was kept completely isolated; all execution and testing took place inside OMAVM.

@llstrk

llstrk commented Sep 21, 2026

Copy link
Copy Markdown

Verified: No actionable issue found in the tested scope at 0f0a65b178f0d48dd1a6f9b3321f7458831c3c22. omarchy-bar put now recovers when a timed-out IPC call is followed by a ready shell.

Production omarchy-bar and omarchy-shell, with synthetic qs responses and real timeouts:

Response sequence Baseline PR
Timeout, then ready Fails on first call Retries successfully
Persistent timeout Fails immediately Fails after retry budget
Timeout, then shell absent Fails Still fails, not silently skipped
Unsupported method Fails Still fails

The added regression test passes on head and fails against baseline production code. An isolated run of the Elsewhen migration with package installation mocked likewise changes from failing on the first timed-out placement to completing on retry.

Retry limit: With a continuously unresponsive synthetic qs and default settings, failure took about 105 seconds (50 attempts), versus 2 seconds on baseline. Recovery is bounded, but a persistently hung shell now delays the error.


Review information

Test scope: Source inspection, baseline/head command tests, and regression-test negative controls. No live desktop, actual plugin-rebuild load, or complete system update was exercised; successful IPC replies do not establish rendered widget placement.

Community review: Independent automated community review, unaffiliated with the Omarchy team, intended to help prepare PRs for their review.

Automated AI review: Initial Astra inspection, independent Fable 5.1 and separate Astra reviews, followed by verification of claims against targeted evidence.

@omarchybot

Copy link
Copy Markdown
Collaborator

Reviewed at 0f0a65b: the fix is correct, and on a worker it fixes the bug.

Reproduced on an Omarchy worker VM. I ran the real omarchy-bar and omarchy-shell against a stub qs whose first call outlasts the IPC timeout, so the omarchy-shell is not responding message came from omarchy-shell's own timeout path. On quattro (821ae58), omarchy-bar put failed on that first timeout with exit 1. On this head, and on this head merged into current quattro, it retried and placed the widget. With the one changed line reverted, it failed again. A shell that never answers still fails once the retry budget is spent ("did not become ready"), so a hung shell is not passed off as success. ./test/cli passes on this head, and bar-test.sh passes 89 of 89 both on this head and merged into quattro. Merged into quattro, ./test/cli has one failure, vscode generated theme references current theme file, which fails the same way on quattro alone and is unrelated to this change.

Retrying is safe. putBarWidget returns early when the widget is already on the bar (shell/services/PluginRegistry.qml, if (inBar(id)) return ""). So a retry after a timeout whose call did land, which is the case #12777 describes, answers "ok" and doesn't place the widget a second time. The cost is that a shell that stays hung now takes about 50 × the 2s timeout to fail, where before it failed at once.

Competing fixes. #13468 and #13608 make the same one-line retry change. #13468 also turns an exhausted retry budget, and a shell that disappears mid-request, into a silent success. #13608 also adds || true to migration 1790042972, which would hide a real error such as an unknown widget id. This PR is the earliest and the smallest of the three, and it fixes the cause without changing what counts as a failure. Whether put should also be best-effort when the shell stays unresponsive, as #13301 asks, is a separate decision for the maintainer.

No second opinion. The reviewer (Codex Medium) answered a ping, but today's review budget is spent, so only one model (Claude Opus 5.5) reviewed this. It is labelled verified. It is not ready, because that needs the second review, and this PR will be looked at again when one can run. Nothing is needed from you.

@ryanrhughes

Copy link
Copy Markdown
Collaborator

Closing in favor of #13468, which merged today and is on v4-5-0 for RC3.

You nailed the root cause here: ask_to_put treated "is not responding" as fatal, and that's what stranded migrations during omarchy update (#12777, #16966). We went with #13468 because it gives timeouts their own short budget (about 10 s, with a "not responding; asking again" line) and lets the update carry on if the shell never answers, instead of retrying up to 50 times and still failing.

Thanks for digging into this, @sanjyay.

@ryanrhughes ryanrhughes closed this Nov 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working verified Omarchy Triage has verified that this issue is ready for final review

Projects

None yet

4 participants