Skip to content

Drive the launch OSD in-process so a lost close cannot strand it - #9819

Merged
dhh merged 5 commits into
omacom:quattrofrom
Yiin:fix-stranded-launch-osd
Nov 21, 2026
Merged

dhh merged 5 commits into
omacom:quattrofrom
Yiin:fix-stranded-launch-osd

Conversation

@Yiin

@Yiin Yiin commented Sep 2, 2026 •

Copy link
Copy Markdown
Contributor

The "Launching Slack…" OSD stayed on screen after Slack had opened. Nothing removed it until a shell restart.

The launcher opens this OSD with duration 0. Only an explicit close removes it. It sends both the show and the close by spawning omarchy-shell, a bash script that forwards to qs ipc with a 2s timeout and no retry. If the close process times out, or runs before the show process, the OSD stays forever. Both cases are easy to hit while the launched app loads the CPU.

The shell already has summon() and hide(). Other plugins use them for the OSD. This change hands the shell to AppLibrary and calls them directly. The calls are in-process and ordered, so a close cannot be lost or overtake a show.

Tested by running the shell from this branch and launching a desktop entry that sleeps 5s, then opens a terminal. The OSD appeared after 2s and closed when the window appeared. ./test/all passes except config-test.sh, which needs an omarchy-pkgs checkout.

https://claude.ai/code/session_017J3tUnyMTMmWF6MDp96LZC

Fixes #8242

Fixes #12123

Fixes #9817

Fixes #11668

Fixes #11928

The launcher opened and closed the Launching… OSD by spawning
omarchy-shell, a bash script that forwards to qs ipc with a 2s timeout
and no retry. The OSD is shown with duration 0, so if that close process
was delayed past the show or timed out while the launched app loaded the
CPU, the OSD stayed on screen until the shell restarted.

The shell already exposes summon() and hide() for plugins and other
plugins use them for the OSD. Hand the shell to AppLibrary and call
them directly. The calls are synchronous and ordered, so the close can
neither be lost nor overtake the show.

Claude-Session: https://claude.ai/code/session_017J3tUnyMTMmWF6MDp96LZC
@paulogeyer

Copy link
Copy Markdown
Contributor

Looks good — this is the right fix for the sticky “Launching…” OSD.

Why: AppLibrary currently show/closes the launch OSD via unordered execDetached → omarchy-shell osd …, with duration: 0. If close runs before show (easy when an Electron app maps around the 2s delay), the toast sticks forever and the 15s timer is already stopped. Driving shell.summon / shell.hide in-process matches how volume/media already use the OSD and removes that race. Keeping duration: 0, the 15s fallback, and the launchOsdOpen guard is correct — a duration-only backstop alone would leave a stale toast after the app is open.

Laptop check: On my laptop (ASUS Vivobook, Intel Arc) I hit the sticky toast once before with Grok Bot; I couldn’t re-stick it today (toast showed and cleared on stock), so this isn’t a live stock-fail → PR-pass soak — just code review + agreement with the race reports on #8242 / #9817 / #12123.

Nit (optional): null-guard shell before summon/hide if AppLibrary can ever be constructed without the shell wiring.

Happy to re-test if maintainers want a forced IPC race harness; otherwise 👍 from me.

Resolves the shell.qml conflict by keeping both host injections: the AppLibrary shell binding from this branch and the BrightnessKeys service quattro added beside it.

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

greptile-apps Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

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

Summary

Launch feedback now calls summon() and hide() directly instead of spawning omarchy-shell.

  • App launch feedback uses the running shell to show and hide the OSD.

Reviews (4) · Last reviewed commit: "Give the launch OSD a finite duration" · Reviewed by Greptile

Comment thread shell/services/AppLibrary.qml Resolved
omarchybot and others added 2 commits October 2, 2026 02:34
hide() closed only a loaded panel and left any payload summon() had queued for its Loader. With the launch OSD now summoned in-process at duration 0, a launch that finished while the OSD was still loading would have that queued show delivered after the hide, and nothing would close it again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Codex Medium <noreply@openai.com>
The menu is keepLoaded and its select and input requests carry a doneFile their caller polls for; dropping a queued payload on hide leaves omarchy-menu-select or omarchy-menu-input waiting forever. The OSD case it covered needs the OSD still loading when a launch finishes, which a host-wide change is the wrong price for.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Codex Medium <noreply@openai.com>
@omarchybot omarchybot added the verified Omarchy Triage has verified that this issue is ready for final review label Oct 2, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

Reviewed and verified on a worker built from the Omarchy ISO. The fix works, and its cause is the one the description gives.

Reproduced. On quattro at f45461a I launched a desktop entry from the Apps menu whose window maps 2.4s after launch, with the shell's spawned omarchy-shell osd show held back by one second, the way a loaded machine delays it. The spawned osd close went out at +2.54s and landed before the show. The "Launching…" OSD was still up 25s later, with the window open and the 15s timeout long past. At this branch's head the same run leaves the OSD closed once the window appears. With a window that takes 6s, the OSD opens at +2.1s and closes at +6.2s, so in-process feedback still shows when it should. The tree minus this change is exactly quattro, so the base run is also the run with the fix reverted.

Pushed to your branch. The branch conflicted with quattro in shell/shell.qml, where quattro added BrightnessKeys { host: shell } on the line beside yours. 17cfeb1 merges quattro and keeps both lines. The two commits after it, 1d9785f and its revert 0f2a4a5, cancel out: the head's tree is your change plus that merge, nothing else.

Tests. test/cli and the 30 test/shell.d files that touch the shell host, the OSD or AppLibrary give the same results here as on quattro, and app-search-test.sh passes 24 of 24. Two failures appear on both and are not caused by this change: vscode generated theme references current theme file and network portal fixture exits cleanly. There is no CI on this pull request.

Second opinion. Codex Medium reviewed three rounds, and the last one, at 0f2a4a5, found no defect. Independence is not guaranteed. It found one narrow residual, which I confirmed in source. If the OSD plugin is still loading when a launch both summons and closes it (at shell start, or during a full plugin reload), hide() leaves the queued summon, and the duration-0 OSD opens late with nothing left to close it. The OSD is keepLoaded, so an ordinary launch can't reach this. Dropping queued summons in hide() would close the gap, but it would also strand omarchy-menu-select and omarchy-menu-input, which wait on a done file a dropped request never writes. Both reviews judged the residual not worth a host-wide change.

Related. This now says Fixes #8242 and Fixes #12123. Both diagnose exactly the race reproduced here. #9817, #13535 and #13566 report the same symptom from a single launch, and on quattro only a lost or overtaken close explains that, but I didn't reproduce their cases. Several open pull requests compete over the same bug by giving the OSD a finite duration instead: #13536, #13669, #13802, #13095 and #13606. Those cap how long a stale toast lasts (5–15s after the show lands) but leave the race. Asked to choose without being given my answer, Codex Medium also picked this one. #12966 (and part of #13095) fixes a different bug, #12922, and could land beside this.

Waiting on the maintainer: which of the competing fixes to take, and the two suite failures already on quattro.

@aholbreich

Copy link
Copy Markdown
Contributor

Triage summary for the stuck "Launching …" OSD, since the bot's reviews point two ways (#11568 is labelled ready, while the review here recommends this PR).

There are two separate causes:

  1. The osd show and osd close are spawned separately with duration: 0, so a lost or overtaken close leaves the toast up forever (Launching… OSD can remain indefinitely due to unordered show/close IPC calls #8242, "Launching <app>…" OSD stays on screen forever when the detached osd close is lost #12123, Launch feedback OSD remains stuck after Cursor and Grok Bot launch #9817, Launch OSD ("Launching <app>…") can stay on screen forever #13535, Launch OSD toast ("Launching X…") can get stuck on screen indefinitely #13566, Launch feedback OSD can get stuck on screen indefinitely (duration: 0 with no fallback closer) #13707). This PR removes that race. Add duration backstop to launch feedback OSD (#11559) #11568, Give launch OSD a finite duration so a lost close can't leave it up #13536, Give launch OSD a finite duration backstop #13669 and Stop Launching OSD from sticking after app launch #13606 instead give the toast a finite duration, which bounds it at roughly 13–15 s but keeps the race.
  2. Every launch calls launchTimeout.restart(), so repeated launches push the safety net out (Launching… OSD toast can get stuck on screen indefinitely #12922). Do not restart launchTimeout on retriggered launches #12966 fixes that in one line, and Keep the launch OSD timeout from being restarted indefinitely #13095 mixes both.

I test-merged all seven onto quattro (81145eb). Each merges cleanly, and the shell tests that touch AppLibrary or the OSD pass on each as on base. This PR conflicts with #11568 and #13536 on the same osd show line; #12966 merges cleanly with any of them. I did not reproduce the race myself; the worker reproductions are in the bot's reviews.

Suggestion: take this PR with a finite duration in the summon payload instead of 0 (for example launchTimeout.interval). That also covers the plugin-loading residual mentioned above, and makes the duration-only PRs redundant. Then add #12966.

With duration 0 only closeLaunchFeedback() takes the toast down, so a summon still queued while the OSD plugin loads (shell start, a plugin reload) opens after hide() has run and never closes. Giving it the rest of launchTimeout (13s) lets that late show dismiss itself. A show that lands on time expires at the same moment launchTimeout would close it, so the ordinary path is unchanged.

Co-Authored-By: SIDDHARTH U <228890207+Cid-oe@users.noreply.github.com>
Co-Authored-By: Walter Andrade <62224146+walteraandrade@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@omarchybot

Copy link
Copy Markdown
Collaborator

Folded a finite duration into the launch OSD and re-verified on a worker built from the Omarchy ISO. Nothing is needed from you.

What changed. 36dedf2 gives the launch toast duration: launchTimeout.interval - launchDelay.interval (13s) instead of 0. Your in-process summon/hide removes the race. One gap was left: if the OSD plugin is still loading (shell start, or a plugin rescan), hide() doesn't cancel the queued summon(), so a duration-0 toast could open late and never close. With the finite duration, that late toast closes on its own. A toast that opens on time expires at the same moment launchTimeout would close it, so the normal path doesn't change. The idea comes from #11568 by @Cid-oe and the expression from #13536 by @walteraandrade, and both are credited as co-authors on the commit.

Reproduced. I launched a desktop entry from the Omarchy menu whose window maps 2.4s after launch, with the CLI's osd show held back 1s. On quattro at 9e0b5e2, the toast was still up at +30s, twice. At 0f2a4a5 and at 36dedf2, it closed at +2.6s, when the window mapped. A window that takes 6s still gets the toast from +2.0s to +6.1s. With no window at all, it closes at +15.4s. For the loading gap, I ran a test-only change on the worker that registers the OSD 3s late, then ran omarchy-shell shell rescanPlugins at +1.5s. At 0f2a4a5 the toast opened at +4.8s and stayed up past +30s. At 36dedf2 it opened at +4.8s and closed at +17.7s.

Before: on quattro, "Launching SlowApp…" is still on screen 10s after the window opened
After: at 36dedf21b, the same moment shows no toast

Tests. I ran test/cli and the 34 test/shell.d files that touch the shell host, the OSD or AppLibrary. With this branch merged with current quattro, test/cli, app-search-test.sh, osd-test.sh and network-captive-portal-test.sh pass. runtime-smoke-test.sh fails "keepLoaded fixture service IPC responds", and it fails the same way on plain quattro in three runs, so it isn't this change. The vscode-theme failure at this head is already fixed on quattro.

Second opinion. Codex Medium and muse-wonder (pi, thinking high) reviewed the new commit and found no defect. Their independence from my review is not guaranteed. Codex noted that a second launch 14s into the first now leaves the first toast to expire about a second before the second's appears. That matches the no-toast lead-in any launch has, so I left it.

Related. #12573, #13566 and #13973 report the same stuck toast from a launch that focuses an existing window. On quattro that case closed normally without a delayed show, so I haven't linked them. The finite duration does bound any launch toast at 13s after it opens. #11568, #13536 and #13606 compete with this one. This one is older and removes the race instead of bounding it, so I'm recommending it, and #11568's improvement is now part of it.

Waiting on the maintainer: the runtime-smoke-test.sh failure that quattro already has, and the choice among the competing fixes.

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

6 participants