Skip to content

Report first-party shell startup failures during restart - #16818

Open
cobrakoral wants to merge 4 commits into
omacom:quattrofrom
cobrakoral:fix/shell-upgrade-recovery
Open

cobrakoral wants to merge 4 commits into
omacom:quattrofrom
cobrakoral:fix/shell-upgrade-recovery

Conversation

@cobrakoral

Copy link
Copy Markdown

A shell restart can currently report success while first-party plugins have failed to load. The root shell ping handler answers independently of asynchronous widget loading, and omarchy-update-restart prints “All plugins have been reloaded” before attempting the restart.

Add shell startupStatus to report configuration/discovery progress, instantiated enabled first-party services, and compiled first-party widgets used by the configured layout. Retain component diagnostics so restart can fail with the plugin ID and QML error. Disabled plugins and unconfigured widgets do not block startup; observed third-party errors are warnings. Preserve core IPC and failsafe lock recovery before checking unrelated plugin status.

The update service phase now announces readiness only after a successful restart and explains a refused or failed restart. It remains best-effort so later update hooks and boot verification still run.

Refs #16126. This is a focused correction to false restart success, not a claim that the reported persistent cache state has been fixed.

Reproduction and limits:

  • Installed Quickshell 0.3.2.r7.g2b4501a-1, Qt 6.12.0, current Omarchy base bc220e7028d5ab0ee467a0f094dd1a8da98b6c0a.
  • In a disposable configuration, replacing a plugin before updating its shared import registry reproduces ShellIpc is not a type and removes the representative plugin IPC target.
  • After completing the new tree, a fresh process succeeds with the same warmed cache. Fresh-cache and disabled-disk-cache controls also succeed. Real file: plugin URLs create compiled qmlcache/*.qmlc files; the warm-cache restart still recovers.
  • The persistent failure from the issue did not reproduce. No cache purge, cache namespace change, package hook, or packaging change is included.
  • The readiness contract concerns discovered startup loads; it does not validate undiscovered/malformed manifests, open lazy panels, or prove every instantiated widget's internal behavior.

Related work:

Validation:

bash test/shell.d/plugins-test.sh
bash test/shell.d/restart-shell-test.sh
bash test/shell.d/update-restart-phases-test.sh
bash test/shell.d/launch-shell-test.sh
bash -n bin/omarchy-restart-shell bin/omarchy-update-restart
git diff --check

The focused regressions fail on the unchanged base and pass with this change. They cover delayed startup status after ping, required plugin failure diagnostics, disabled/unconfigured optional plugins, third-party warnings, existing live-lock refusal and failsafe recovery, and update-phase failure reporting. Script fixtures exercise the real orchestration with dependency stand-ins; they do not establish Qt cache behavior.

The included isolated offscreen Quickshell fixture executes the production loader/status functions with real QML components. It observes loading → failed → ready, verifies the import error, instantiates a representative ShellIpc component, and calls its IPC through both the registry and Quickshell's external client. It is a reduced host, not a complete desktop integration test.

The aggregate CLI suite passes. The aggregate shell run has 13 failures out of 404 files: ten also fail individually on the base; the other three (i18n-startup, passwordless-sudo-indicator, preinstalls) pass individually on both base and changed trees. Their parallel-run failure causes remain unestablished. Graphical tests are skipped without a compositor. QML lint finds the same existing unqualified-access warning on both trees; ShellCheck finds the same existing SC2053/SC2001 reports on both trees.

No real upgrade, active desktop restart, live lock manipulation, or user-cache deletion was performed.

@greptile-apps

greptile-apps Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no actionable defects were found.

Summary

Adds shell startupStatus so a responding IPC handler no longer counts as proof that required startup loads succeeded.

  • Shell restarts wait for required startup loads before reporting success.
  • The update phase announces shell readiness only after a successful restart.

No actionable issues were found. Review checks were based on the diff and current code; tests were not run.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Restart shell] --> B[Wait for core IPC]
  B --> C[Restore failsafe lock if needed]
  C --> D[Check startupStatus]
  D --> E{Startup state}
  E -->|loading| D
  E -->|failed or timeout| F[Report restart failure]
  E -->|ready| G[Wait for notifications and restore invitations]
  F --> H[Update reports failure and continues]
  G --> I[Update reports readiness and continues]
Loading

Reviews (2) · Last reviewed commit: "Report the shell restart outcome during ..." · Reviewed by Greptile

Track initial configuration, plugin discovery, service instances, and configured widget compilation independently of root IPC. Retain load diagnostics, gate readiness on enabled first-party plugins, and report third-party errors as warnings.

Document the IPC contract and cover loading, failure, exclusions, and readiness with the production status calculation.
Add an isolated offscreen Quickshell fixture using the production loader and status functions. Check compilation diagnostics, optional-plugin exclusions, widget instantiation, and registry and external IPC calls.

Run it from the plugin suite when Quickshell is available; keep it separate from the pure status-contract checks.
After core IPC responds and failsafe lock recovery re-secures the session, wait for startupStatus to become ready. Fail with retained plugin diagnostics or a bounded timeout, and surface third-party warnings.

Keep notification readiness separate. Cover delayed startup, required-plugin failures, and existing lock recovery behavior, and document the restart contract.
Announce startup readiness only after omarchy-restart-shell succeeds. Explain a refused or failed restart while keeping the service phase best-effort so later update phases can continue.

Add a regression for a refused restart and suppress the premature success message.
@cobrakoral
cobrakoral force-pushed the fix/shell-upgrade-recovery branch from 1e080d5 to 8c31c74 Compare October 28, 2026 21:34
@cobrakoral

Copy link
Copy Markdown
Author

I reviewed this PR together with #16880 to evaluate their interaction and determine whether either change supersedes the other.

My conclusion is that both PRs are complementary and should remain separate. I recommend merging #16880 first and this PR second.

The distinction is important: #16880 mitigates a reproduced persistent QML disk-cache coherence failure, whereas this PR corrects the shell restart readiness contract.

A successful root IPC ping only establishes that the IPC endpoint is responding. It does not establish that asynchronously loaded first-party services and configured widgets have completed initialization successfully.

This PR addresses that gap through shell startupStatus, allowing the restart operation to distinguish loading, failed, and ready states and report actionable QML diagnostics when required components fail.

I particularly support preserving the existing restart sequence: establish core IPC, restore the failsafe lock when necessary, and only then check plugin readiness. This avoids making security-relevant lock recovery depend on unrelated plugin initialization.

The distinction between required first-party components, disabled or unconfigured components, and third-party warnings also keeps the readiness contract appropriately scoped. Similarly, retaining best-effort behavior in the update phase prevents a shell restart failure from unnecessarily aborting subsequent update operations, without falsely announcing successful startup.

The relationship with #16880 is straightforward:

Neither implementation needs the other to function. Their current diffs do not overlap, and merging them independently preserves a clearer history and smaller review surfaces.

For combined integration testing, I would focus on three scenarios:

  1. Recovery: Start through the cache-protected launcher with a previously poisoned cache and verify that the required components load, their IPC targets work, and startupStatus eventually reports ready.
  2. Failure reporting: Introduce a genuinely invalid first-party component and verify that root IPC remains responsive while startupStatus reports failed, including the plugin identifier and QML diagnostic. The restart must not report success.
  3. Real graphical startup: Verify that one complete restart under Hyprland reaches ready within the existing timeout, particularly because disabling disk caching can increase startup work.

The existing focused tests already cover much of the failure classification and restart orchestration. The remaining value is validating both mechanisms together in the same Quickshell process and performing a limited graphical smoke test.

The aggregate shell-test failures reported by both PRs should be evaluated against their respective baselines rather than compared as raw counts. They do not, by themselves, establish a regression caused by either change.

Conclusion: I support #16818 as an independent observability and correctness improvement, not as a substitute for #16880's cache mitigation. Merging #16880 first and this PR afterward provides a logical progression from mitigating the reproduced failure to reliably reporting any remaining startup failures.

@omarchybot

Copy link
Copy Markdown
Collaborator

Thanks for this, @cobrakoral. Triage got as far as classifying it and stopped there, because the two models classifying it disagreed.

  • Claude Opus 5.5 classified it as a bug: omarchy-update-restart prints "All plugins have been reloaded" before the restart is even attempted, and omarchy-restart-shell reports success once root IPC answers to ping, even when first-party plugins failed to load. That is wrong output from code that already exists.
  • Codex Medium, asked the same question separately, classified it as an enhancement: it adds a new shell startupStatus IPC method and a new readiness contract to the restart path.

Because the classification is unsettled, no type label went on and nothing was run on a worker. Neither model has reviewed the diff line by line or tested it yet. It is waiting on the maintainer to decide whether this is a fix or a feature, and the review follows from that decision.

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.

2 participants