omarchy icon indicating copy to clipboard operation
omarchy copied to clipboard

First-agent OAuth browser opens tiled under the 875×600 setup terminal

Open unleashed-nick opened this issue 3 months ago • 4 comments

System details

  • Omarchy 4.0.0-1
  • Hyprland 0.56.2
  • ThinkPad T480, Intel Core i5-8350U, UHD Graphics 620
  • Display: eDP-1 1920×1080 @ 1.6 scale (logical 1200×675)
  • Chromium 151.0.7922.137-1
  • Fresh install / first login

What's wrong?

On first-run, choosing a default agent (Grok) opens a floating org.omarchy.terminal installer (title "Omarchy"). After install it execs the agent in that same window. The agent then opens Chromium for device OAuth (https://accounts.x.ai/oauth2/device?...).

The login window appears centered under the installer. There is no obvious way to reach it.

Why

Shipped rules in default/hypr/apps/system.lua tag org.omarchy.terminal as floating-window: float, center, 875×600.

On a 1920×1080 panel at 1.6× scale the usable area is 1200×675, so that float covers almost the whole screen (≈160px sides, ≈37px top/bottom before bar and gaps).

default/hypr/apps/browser.lua forces Chromium tiled. Hyprland keeps floats above tiles, so the browser stays hidden. Alt+Tab can focus Chromium but cannot raise a tiled window above a float. Super+Tab only changes workspace.

Grok launches Chromium with a bare URL (uwsm-app -- /usr/bin/chromium 'https://accounts.x.ai/oauth2/device?...'), not omarchy-launch-browser, so the focus helper never runs. Even if it did, focus would not lift the tiled window above the float.

Journal for the session:

omarchy-default-agent --install grok
# via xdg-terminal-exec --app-id=org.omarchy.terminal --title=Omarchy
uwsm-app -- /usr/bin/chromium 'https://accounts.x.ai/oauth2/device?user_code=...'

Steps to reproduce

  1. First login (or no default agent set).
  2. Use the "Set your default agent" invitation / omarchy menu summon setup.default.agent.
  3. Pick Grok (any agent that opens a browser to log in).
  4. Wait for the installer to start the agent and open the OAuth page.

Expected: the login page is visible and usable. Actual: Chromium is tiled under the 875×600 centered float and cannot be reached.

Workaround

Super+drag the installer aside, or Super+T on it to tile both windows.

Notes

While the hidden Chromium window sat there it later aborted with SIGTRAP (GPU process isn't usable. Goodbye. from gpu_data_manager_impl_private.cc:417). That is a Chromium/Mesa abort, not this stacking bug.

Filed by Grok 4.6 via Grok Build.

unleashed-nick avatar Aug 16 '26 19:08 unleashed-nick

Correction from the reporter: the Chromium SIGTRAP was not an idle GPU abort. Closing the covering setup window (or the hidden browser under it) is what triggered the crash.

Timeline still matches: Chromium PID 9960 started at 14:32:25 on the device-login URL, dumped at 14:34:34 with GPU process isn't usable. Goodbye., and Grok opened a new Chromium on a fresh device code 23 seconds later.

So the stacking bug is still the primary issue; the SIGTRAP looks like Chromium/Mesa failing during the close/unmap/resize that followed, not a spontaneous crash.

Filed by Grok 4.6 via Grok Build.

unleashed-nick avatar Aug 16 '26 19:08 unleashed-nick

Second reproduction, this time with Claude Code instead of Grok, and on an unscaled panel — which turns out to change the symptom without changing the bug.

System

  • Omarchy 4.0.2-1, Hyprland 0.56.2-1, Chromium 151.0.7922.173-1, uwsm 0.26.7-1, kernel 7.1.9-arch1-2
  • Intel Celeron N4120 / UHD Graphics 600 (8086:3185)
  • eDP-1 1366×768 @ 60Hz, scale 1 (no fractional scaling)
  • Fresh install, first login, "Set your default agent" invitation → Claude Code

What happened

Sep 05 21:02:14  uwsm_app-daemon: received: app -- xdg-terminal-exec \
  --app-id=org.omarchy.terminal --title=Omarchy -e bash -c \
  'omarchy-show-logo; omarchy-default-agent --install claude; if (( $? != 130 )); then omarchy-show-done; fi'

Sep 05 21:08:49  ~/.claude/.credentials.json written

6m35s between the setup window opening and the OAuth actually completing. Nearly all of that was hunting for a browser window with no on-screen indication that one had opened. The login itself takes seconds once you can see it.

The unscaled case is arguably worse

On 1366×768 at scale 1 the centered 875×600 float leaves ~245px of margin on each side and ~84px top/bottom, so the Chromium window is partly visible around the edges. You can see it. You can click it and it takes keyboard focus. It still never comes forward, because Hyprland keeps floating windows above tiled ones and default/hypr/apps/browser.lua:4 pins chromium-based browsers to tile = true.

That makes it more confusing than the fully-covered case, not less: something is clearly there, clicking it appears to do nothing, and there is no affordance suggesting Super+drag or Super+T. For a first-login user who has owned this machine for six minutes, the reasonable conclusion is that the install hung.

Still present on quattro today

bin/omarchy-launch-floating-terminal-with-presentation, bin/omarchy-launch-browser and default/hypr/apps/system.lua on quattro are byte-identical to what ships in 4.0.2. system.lua:2-10 still tags org.omarchy.terminal float/center/875×600; browser.lua:4 still forces tile = true.

One difference from the Grok path

Claude Code opens the OAuth URL through $BROWSER. Inside the presentation terminal BROWSER is unset (#8961: bash -c is non-interactive, so default/bash/envs never loads), so it falls through to spawning Chromium directly and omarchy-launch-browser's omarchy-hyprland-focus-app call never runs.

Worth noting for anyone reading these two issues together: #9040 does not fix this one. Restoring BROWSER detaches the browser from the terminal's process tree — that fixes the SIGTRAP-on-exit in #8961 — but focus is not the problem here. omarchy-hyprland-focus-app focuses a tiled window; it cannot raise one above a float. Both issues have to be fixed for the first-agent flow to work end to end.

Fix in #10361: a browser opening tiled under the presentation float gets moved into the floating layer, raised and focused. Doing it in window management rather than in the launch path keeps it working for agents like Grok that spawn Chromium directly instead of going through $BROWSER.

Reproduced and written up with Claude Code on the affected machine.

gradlman avatar Sep 05 '26 20:09 gradlman

I ran into what looks like the same handoff, with a symptom that outlasts the OAuth step.

On a fresh install the setup terminal keeps the agent session, so the window class used for transient installers ends up as the class of a long-running app:

foot --app-id=org.omarchy.terminal --title=Omarchy -e bash -c \
  "omarchy-show-logo; omarchy-default-agent --install claude; ..."

That window floats at 875×600 for the whole session, not only during install. Every later launch goes through omarchy-agent:137:

exec omarchy-launch-tui --app-id=org.omarchy.agent "${command[@]}"

org.omarchy.agent matches no float rule, so it tiles. The result is that a user's first agent session floats over their work and every session after it tiles, with nothing on screen to explain the difference. I hit this as a new user and assumed the window manager was behaving inconsistently before finding this issue.

One detail that may matter for whichever fix is chosen: org.omarchy.terminal is also used by install.package, install.aur and remove.package, where floating is the right behaviour. So the class itself probably shouldn't be retagged.

Maybe the solution could be to have the installer hand off to org.omarchy.agent once setup finishes, so the first run matches every later run and the transient windows keep the float treatment they need. I don't know the codebase well enough to say whether that is straightforward, or whether it would also help the neighbouring reports that seem to touch the same launch path — #8961, #8122, #10128, #9008, #6379. The reporter in #9008 suggested deciding in omarchy-agent "where the terminal is known, rather than in a class-based window rule", which sounds related, but I may be misreading how connected these are.

Happy to test a patch or provide more detail if useful.

Observed on Omarchy 4.0.3-mac.1 (omarchy-dev, edge), Hyprland dwindle, MacBook Pro 14-inch M1 Pro. Doesn't appear hardware-specific — this issue is a ThinkPad.

omeganter avatar Sep 14 '26 11:09 omeganter

Thanks for the detailed report, @unleashed-nick, and to @gradlman and @omeganter for the extra reproductions.

The bug is still present on quattro (902fd8aeb). I confirmed it by reading the source; I did not reproduce it graphically. bin/omarchy-default-agent:78 runs the install in omarchy-launch-floating-terminal-with-presentation, which opens as org.omarchy.terminal. default/hypr/apps/system.lua:2-10 makes that window float, centred, at 875×600. After the install, bin/omarchy-default-agent:101 runs exec omarchy-agent --inline, so the agent and its login stay inside that float. default/hypr/apps/browser.lua:4 forces Chromium to tile, and Hyprland always draws floating windows above tiled ones, so the login page opens underneath the float. Focusing the browser does not lift it above the float.

Three open pull requests address this, and they cover different amounts of it:

  • #10361 (says it fixes this issue) watches for new windows. When a browser opens tiled on a workspace where the setup float is showing, it floats that browser, raises it and focuses it. Because it reacts to the window rather than to how the browser was started, it also covers agents like Grok that start Chromium directly. One gap: if the login opens as a tab in a browser window that is already open, no new window appears, so the watcher does nothing.
  • #6828 opens the first agent session in a normal org.omarchy.agent window, detached from the installer. The installer then shows "Done! Press any key to close" (bin/omarchy-show-done) and stays up as a float until it is dismissed. Until then the agent and its login page are still underneath it, so it fixes this issue only partly.
  • #14297 (for #14289, which reports the same symptom) runs exec omarchy-agent and adds --close-on-success so the float closes once the command returns. But omarchy-launch-tui ends in exec setsid uwsm-app …, and inside the presentation script setsid does not fork, so the command does not return until the agent's own terminal closes. The float stays up for the whole login. A worker run during review of #6828 saw exactly this with a plain exec omarchy-agent: the installer sat open beside the agent for the whole session.

#6828 and #14297 change the same lines of bin/omarchy-default-agent, so they conflict with each other. #10361 does not touch that file and could land alongside either one. Choosing between them is the maintainer's decision.

Who checked: Claude Opus 5.5 diagnosed this. Codex Medium reviewed the diagnosis and the three pull requests as a second opinion. It agreed with the diagnosis; its independence is not guaranteed. It also found two things on its own: #14297's float does not close, and #10361 misses a login that opens as a tab in an existing window.

Nothing is needed from the reporters. This is waiting on the maintainer to choose among the fixes.

omarchybot avatar Oct 08 '26 07:10 omarchybot