fix: start the AT-SPI registry on the headless session before the shell - #4
Open
timrichardson wants to merge 1 commit into
Open
timrichardson wants to merge 1 commit into
timrichardson wants to merge 1 commit into
Conversation
… had nothing to talk to A private dbus-daemon cannot activate at-spi2-registryd: the a11y broker routes the start through org.freedesktop.systemd1, and on a bus with no systemd that name is the stub that answers /bin/false. So the headless a11y bus existed but no registry ever owned org.a11y.atspi.Registry, and ui_tree/ui_find failed with 'no application named gnome-shell' while the user's real session, whose bus has real systemd behind it, worked. headless.py now starts registryd itself, BEFORE the shell: order matters, because the shell's atk-bridge stops retrying registration when no registry answers (measured: registry-after-shell = 16/18 self-test, registry-before-shell = 18/18). Unit tests for the spawn/liveness/stop paths run anywhere; the live proof is tests/test_headless_atspi.py, which fails 2/3 checks on main and passes 3/3 here, and a cold headless self-test at 18/18.
timrichardson
marked this pull request as ready for review
September 15, 2026 03:48
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #3.
What this changes
A headless session's private dbus-daemon cannot activate
at-spi2-registryd: the a11y broker routes the start throughorg.freedesktop.systemd1, and on a bus with no systemd that name is the stub answering/bin/false. So the headless a11y bus existed but no registry ever ownedorg.a11y.atspi.Registry, and everyui_*tool failed with "no application named ...".headless.pynow spawns registryd itself, before the shell, because order matters: a registry that appears after the shell answers still leaves the self-test at 16/18 (the shell's atk-bridge stops retrying; apps started later were on the bus while gnome-shell was not, same session). The registryd is recorded in the state file and ended bystop();--use-gnome-sessionalso makes it exit with the bus.How it was proven
ruff check .cleanpython3 -m pytest -q— headless suite green, 398 passed (8 new unit tests for the spawn/liveness/degrade/stop paths)tests/test_headless_atspi.py(new, the scripted repro from headless session: the AT-SPI registry never starts, so ui_* tools fail with 'no application named ...' (self-test 16/18) #3 turned into a live check) — 2/3 onmain(fails: registry not owned), 3/3 on this branch;tests/test_two_sessions.pynot re-run, this change is inside the single-session start path it wrapsDESKWRIGHT_SESSION=headless ./mcp_server.py --self-test— 18/18 on a cold start (was 16/18 onmain); registry is up before the shell, which now registers like any primary-session appAnything a reviewer should be suspicious of
_registryd_path()hardcodes/usr/share/dbus-1/accessibility-services/..., which is where every distro I checked installs it, but it is a fallback for a binary that is normally on PATH or in/usr/libexec._seed_homeand the shell spawn; if a future change moves it after the extension-readiness wait again, the self-test will say 16/18 and the reason will not be obvious. The comment block there says this in place.Left in draft pending dog-food testing: running this as my daily headless driver for a few days before asking for review.