Conversation
Automated AI review
Verified: the supervisor fixes the stale-agent problem from #11936. With the real bluez-tools Verified in the same setup:
Every session lists the entire system bus every 2 seconds
The removed Impact: a small but permanent background cost on every session where the unit runs, including machines with a Bluetooth adapter that never run BlueZ. The real system-bus size and dbus-broker timings were not measured; the call count scales with the number of names on the bus. Suggested change: query only the A failed probe is treated as a BlueZ replacementcurrent_bluez_pid=$(bluez_pid)
if [[ $current_bluez_pid != "$initial_bluez_pid" ]]; then # "" or "-" also differs
stop_agent
exit 1Any empty or Impact: a transient probe failure causes an unnecessary restart with no agent registered for about 1 second. The persistent Suggested change: exit only when the probe succeeds with a different owner, or definitively reports the name absent. Treat other errors as "unknown, poll again". Comparing unique names as suggested above removes the dependence on the PID column, but a failed call still needs this handling. Running sessions keep the old agent until the next loginThe PR adds no migration. Arch's user daemon-reload hook reloads unit files after the package update but does not restart running units. So an already-running Impact: on existing sessions, the fix only takes effect after the next login. Until then a BlueZ restart can still leave pairing without an agent. Suggested change (optional): add a migration that restarts the unit for existing sessions without enabling units the user disabled. Optional: Optional test improvement:
Related open PRs: these change the same
The owner supervision here still applies if Review informationTest scope: source review of the head AI process: Opus 5.5 Medium coordination and synthesis, Opus 5.5 Xhigh technical review and final fact check, GPT 6 Sol Xhigh search for related issues, Opus 5.5 Medium editorial check. Opt out: To stop receiving these reviews, reply to this comment saying so. |
Summary
bt-agentagainst the currentorg.bluezownerbluetoothdis replacedbt-agentignores SIGTERMProblem
Agent registrations belong to one
bluetoothdprocess. When BlueZ restarts, the existingbt-agentprocess remains alive and systemd considers the user service healthy, but the replacement daemon has no registered agent. Pairing then stalls at Connecting while BlueZ logs:The previous
ExecConditionalso made a login-time race permanent: if the user service started before the system BlueZ service, the agent was skipped until manually restarted.Verification
./test/shell.d/bluetooth-agent-test.sh./test/shell.d/systemd-test.sh./test/clibash -n bin/omarchy-bluetooth-agent-supervisor test/shell.d/bluetooth-agent-test.shgit diff --checkbluetoothd, the supervisor replaced the agent within one polling interval and both a Logitech K850 and MX Master 3S reconnected within 14 seconds./test/allreaches the new tests successfully. Its six failing files are pre-existing host/fixture failures; five reproduce exactly from an untouchedf2b419d9worktree, and the sixth (locate-test.sh) passes alone and is test-order contamination.Fixes #11936