Skip to content

fix(webapp): exit when the browser Exec is empty - #14200

Closed
kvnloo wants to merge 5 commits into
omacom:quattrofrom
kvnloo:fix/launch-webapp-empty-exec-14163
Closed

kvnloo wants to merge 5 commits into
omacom:quattrofrom
kvnloo:fix/launch-webapp-empty-exec-14163

Conversation

@kvnloo

@kvnloo kvnloo commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

Summary

"omarchy-launch-webapp" can fall back to "chromium.desktop" while Chromium is not installed. The resolved "Exec" is then empty and "uwsm-app" receives "--app=" as though it were a path.

This keeps the existing Chromium-only allowlist and fails clearly before browser handoff when no "Exec" can be resolved.

Closes #14163.

Credit: @TowhidMolla-Dev reported the root cause and minimal fail-closed direction in #14163. This PR implements that direction and adds regression coverage.

Verification

bash test/shell.d/launch-webapp-empty-exec-test.sh

All three regression cases pass.

Zen falls through to chromium.desktop. When that entry has no Exec, do not
call uwsm-app with an empty command. The Chromium allowlist is unchanged.
@greptile-apps

greptile-apps Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no new actionable failure was identified.

Summary

The PR makes web-app launch fail before browser handoff when no browser Exec is resolved. The revised regression test uses desktop-entry fixtures and the real lookup path instead of mocking sed.

Reviews (4) · Last reviewed commit: "test(webapp): exercise desktop entry loo..." · Reviewed by Greptile

@chessing234 chessing234 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requesting changes on b90faeb.

[P2] Isolate the desktop-entry lookup in the new regression test (test/shell.d/launch-webapp-empty-exec-test.sh:51-57). The zen.desktop case falls back to chromium.desktop, and the real launcher searches both the fake user's application directory and /usr/share/applications. On a host with Chromium installed, it finds a valid Exec, launches through the stubs, and returns 0; the test expects 1. Changing HOME does not hide the host's /usr/share/applications/chromium.desktop.

The supplied test passes here when Chromium is absent. I repeated it with a Chromium desktop entry in one of the actual searched application directories, without modifying /usr, and reproduced status=0 followed by not ok - empty browser exec exits 1. The same lookup makes the case fail on a Chromium-equipped Linux host.

Please control the desktop-entry search result for the missing-Exec cases while also retaining a separate valid-Exec case. This confirms the existing host-dependent-test thread; I did not find a defect in the added empty-Exec guard itself.

@jandrusk

jandrusk commented Oct 6, 2026

Copy link
Copy Markdown

Thanks for picking this up from #14163. Failing closed here makes sense. Two things:

  1. The new test depends on the host: the launcher always searches /usr/share/applications, so on a machine with Chromium installed the zen.desktop case finds a real Exec and exits 0. The simplest fix is to skip that case when the host has Chromium:

    if [[ -e /usr/share/applications/chromium.desktop ]]; then
      echo "skip: host chromium.desktop shadows the empty-Exec case"
    else
      status=$(run_launch zen.desktop)
      # ...
    fi

    A cleaner option is letting the launcher take its search dirs from an env override that the test can point at a temp dir.

  2. Web apps are mostly launched from keybindings and the app grid, where stderr goes nowhere. Could the failure also raise a notification, e.g. omarchy-notification-send -u critical "Can't open web app" "No supported browser found"? Warn clearly when no Chromium browser can launch a web app #9206 ("Warn clearly when no Chromium browser can launch a web app") goes in that direction too. It's conflicting right now, but it'd be worth checking so the two don't overlap.

kvnloo added 2 commits October 7, 2026 11:51
Plant a host-like chromium.desktop outside OMARCHY_APPLICATIONS_DIRS so
the zen fallback cannot false-pass when a real Exec exists on the host
search path (Chessing234 / jandrusk on omacom#14200).
Let tests point the launcher at an isolated applications tree so a host
chromium.desktop cannot shadow the empty-Exec fail-closed path. Default
search order is unchanged when the override is unset.

kvnloo commented Oct 7, 2026

Copy link
Copy Markdown
Contributor Author

Thanks Chessing234 and jandrusk — the empty-Exec regression is now hermetic.

omarchy-launch-webapp honors OMARCHY_APPLICATIONS_DIRS (colon-separated applications dirs). The test points that at a temp tree and plants a host-like chromium.desktop outside it under ~/.nix-profile/share/applications, so a real host Chromium entry can no longer shadow the zen→chromium fail-closed path. The allowlisted valid-Exec case still launches.

On the notification idea: #9206 already covers a clear warn + desktop toast for missing Chromium-family browsers, so I left notify out of this PR to avoid overlap. Happy to revisit if you'd rather see a minimal critical toast here too.

@jandrusk

jandrusk commented Oct 8, 2026

Copy link
Copy Markdown

Thanks. OMARCHY_APPLICATIONS_DIRS is the cleaner option, and planting a host-like chromium.desktop outside the isolated tree proves the test no longer depends on the host. Leaving the notification to #9206 makes sense too. LGTM from my side.

@omarchybot

Copy link
Copy Markdown
Collaborator

Reviewed by reading the diff at a92a616 against current quattro, along with #14163 and the other open pull requests that touch bin/omarchy-launch-webapp. Nothing was run on a worker for this pass.

The classification is unsettled, so this got no label. Claude Opus 5.5 classified it as a bug fix: on quattro, with a default browser outside the Chromium allowlist and no chromium.desktop, the Exec lookup comes back empty and the launch becomes uwsm-app -- --app=<url>, which fails with the path error in #14163. The second opinion (Codex Medium) did not run because its daily review budget was already spent. A label needs both models to agree, so none went on.

#13879 fixes the same bug and was opened first (30 September, before this one on 4 October). It is built on the current launcher too, and it also exits 1 when no browser command resolves. On top of that it sends a critical notification, which covers the keybinding and app-grid launches jandrusk raised above, where stderr goes nowhere. It also falls back to any installed Chromium-based browser instead of only chromium.desktop. The guard in this pull request is a subset of that change, so if #13879 lands, this one has nothing left to add. When competing fixes are this close, the older one is preferred, and I found nothing this one handles that #13879 misses. #13879 links #7034 rather than #14163, but it fixes the same failure.

Two small things in the test, for whichever way this goes:

  • The second case, "the browser allowlist is not widened", runs exactly the same run_launch zen.desktop as the first, so it proves nothing the first case doesn't.
  • The test is isolated from the host without OMARCHY_APPLICATIONS_DIRS, which the head no longer has. The planted Exec= line in ~/.local/share/applications/chromium.desktop is read first and yields an empty command, so it shadows a host /usr/share/applications/chromium.desktop.

This is now waiting on the maintainer to choose between this pull request and #13879. The classification also needs a second opinion that actually ran.

@kvnloo

kvnloo commented Nov 24, 2026

Copy link
Copy Markdown
Contributor Author

Closing: #16422 (ef93001) added the same empty-Exec guard to omarchy-launch-webapp on quattro, with a critical notification and a Chrome/Chromium fallback, so this has nothing left to add. Prepared by Claude Opus 5.5 via Hermes Agent; reviewed under kvnloo's account.

@kvnloo kvnloo closed this Nov 24, 2026
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.

omarchy-launch-webapp fails silently for browsers missing from its allowlist (e.g. Zen)

4 participants