Repository navigation
Conversation
|
One error-reporting regression found at Verified: With synthetic Preserve failures from per-adapter blocksIn Synthetic failure through the real helper: A concrete applicable condition is readable Impact: CLI callers receive success even though Bluetooth was not turned off. The backend error still reaches stderr; this does not introduce a new panel error-display problem. Suggested change: Attempt all selected adapters, aggregate their block failures, and return nonzero if any block fails. Preserve the fallback command's status as well. Review informationTest scope: Pinned source review and isolated synthetic-backend checks. No physical radio, firmware, UI, reboot or suspend/resume validation; the full upstream suite was not run. Community review: Independent automated community review, unaffiliated with the Omarchy team, intended to help prepare PRs for their review. Automated AI review: Astra Medium initial inspection and synthesis, independent Opus 5.5 High and GPT 6 Sol Xhigh technical reviews, and verification of the reported claim against source and retained targeted evidence. |
|
Fixed in 9767161 — block_adapters attempts every listed adapter, returns nonzero if any block fails, and keeps the fallback command's own status. Added a failing-block case to the bluetooth test using your readable-without-write example. Whole bluetooth file green. |
Automated AI review
Follow-up at Verified: (Base exits 0 in the two-adapter row because it issues one type-wide block, which the synthetic model lets succeed.) The util-linux source matches the modeled condition: Author's "whole bluetooth file green": the shell section of Optional test improvement: the new case uses one adapter and fails every block. Three altered helpers still pass it: one that stops at the first failure, one that escalates a failure to Review informationTest scope: Pinned source review of AI process: Opus 5.5 Medium coordination and synthesis, independent Opus 5.5 Xhigh (source review and isolated synthetic runs) and GPT 6 Sol Xhigh (source-only) technical assessments of this follow-up, and an Opus 5.5 Medium editorial check. Opt out: To stop receiving these reviews, reply to this comment saying so. |
|
Done in d03abf5 — added the two-adapter partial failure case (fail ID 1 of hci0+hci1, asserting both IDs are attempted, nonzero exit, and no type-wide block) plus a failing-fallback case. I checked all three broken variants you named against it: early return fails on "attempts every adapter", type-wide escalation fails on "does not escalate", forced success fails on the exit assertions. |
Automated AI review
Follow-up at Verified: Verified: the two added cases (two adapters with only ID 1 failing; platform-only listing with a failing fallback) catch each altered helper described in the previous review. Altered helpers were written from those descriptions and run with the test file's synthetic The author's account holds, with one detail: an escalating helper that returns the type-wide block's success is caught by the exit check just before the escalation check. Every variant still fails the updated test. The earlier checks in the file produce identical results under both test versions. Review informationTest scope: Pinned source review of AI process: Opus 5.5 Medium coordination and synthesis, independent Opus 5.5 Xhigh (source review and isolated synthetic runs) and GPT 6 Sol Xhigh (source-only) technical assessments of this follow-up, and an Opus 5.5 Medium editorial check. Opt out: To stop receiving these reviews, reply to this comment saying so. |
|
Tested on real hardware at Before (4.0.4): With this PR: Side note (not caused by this PR): blocking hci0 while the Intel firmware is still loading left bluetoothd failing |
|
Tested on real hardware at This run goes through the bar widget, not only the helper. I cloned Before, with the 4.0.4 helper: With this PR, two full cycles, identical both times: The kernel logged no USB disconnect. While off, systemd-rfkill stored The adapter never leaves D-Bus, so the stock |
|
Reviewed at What ran, on a disposable Omarchy VM (kernel 7.2.5, util-linux 2.42.3):
What a VM cannot show: a VM has no platform switch, so it cannot reproduce the USB disconnect itself. Two people have tested this head on ThinkPads in the comments above: @symonbaikov on a P15v Gen 3 and @gregstephensjr on a T420. Both saw no USB disconnect, and the platform switch stayed unblocked. Because this fix depends on hardware, the confirmation that settles it has to come from the account that reported the bug. @DrakeMorrison, could you try this exact commit on the E16 Gen 1? The helper is self-contained, so you can run it without installing anything: It works if Related: 12585, 13655, 13204, 10749, 7065, 13806, 12241, 10003 and 11252 all change the panel so it copes with an adapter that has disappeared. This PR stops the adapter from disappearing on this class of hardware, so the two work at different layers and don't compete. Which of the panel PRs to take is a separate decision for the maintainer. Who checked it: reviewed by Claude Opus 5.5. The configured second opinion (Codex Medium) did not run because the daily review allowance was used up, so this review has not been checked by a second model. |
|
Tested Method: this PR's
What this PR can't fix on ThinkPads: "off" still doesn't survive a reboot (5/5). The saved hci0 block is restored, then Note for anyone testing reboots: Tested with help from Claude Code; every run was on my machine. |
|
Follow-up at the same head, What's new since my last comment:
Overlap for the maintainer: #13667 and #13867 both edit the same |
|
When The new test locks that in. This runs whenever no hci* index exists yet: the controller is still probing, enumeration has failed and the platform switch is the only Bluetooth rfkill, and migration The guard is to block hci* indexes and issue no type-wide block. With no hci* device, |
|
Good catch, and thank you for the trace — the mechanism is exactly as you describe, and that fallback was the one path left where the platform switch could still be tripped. I've kept the fallback, but only for a case with no platform switch in it. Behaviour at
So the type-wide block now fires only when the read succeeded and showed no switch whatsoever. That is the one case where there is no platform switch to trip, and issuing no block there would leave The tests assert each end. Verified at I also picked up the wording note from the earlier review: the header comment no longer claims systemd-rfkill keys its saved state by rfkill ID — it uses the device path. If you'd rather the type-wide block go entirely, empty listing included, say so and I'll drop it — that is the only place it is left. |
[Medium impact] The PR appears safe to merge; no new blocking issue was found. SummaryChanges
Reviews (3) · Last reviewed commit: "Merge quattro into fix-bluetooth-rfkill-..." · Reviewed by Greptile |
A failed `rfkill list` (no /dev/rfkill, or one that cannot be opened) left block_adapters() returning 0 with rfkill's error discarded, so `off` reported success while the radio stayed on; quattro exits 1 with the error there. Keep blocking nothing on a failed listing, but return its status and let the error through, as a refused block already does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Reviewed The new commit holds. A platform switch listed with no What I fixed: when What ran, on a disposable Omarchy VM (util-linux 2.42.4), with the branch merged into current
What a VM cannot show: a VM has no platform switch, so it cannot reproduce the USB disconnect itself. The ThinkPad reports above were all at It works if Who checked it: reviewed by Claude Opus 5.5, with Codex Medium as the second opinion over two rounds. On |
|
Hardware confirmation of Machine: ThinkPad X1 Carbon Gen 12 ( Before (installed Only
Not tested: persistence across a reboot, and suspend/resume (the known limitation in the PR description). Drafted by Claude Opus 5.5 via Claude Code; every value above was read on this machine. |
|
@robi42 thank you for running it — that's the fourth machine and the third radio vendor with a positive result at the current head ( Coverage now, all on real hardware with the platform switch present:
That covers the three vendors that report the USB-disconnect failure, and two point releases of the stack, so the behaviour does not depend on the util-linux version. Since @vstoyanov's trace the only change to the block path was So as far as I can tell nothing is outstanding from the reporters' side — this is ready for a maintainer look. |
|
Follow-up at the same head, @robi42's report is useful. It is the first test on real hardware at this head, and it covers the new platform-switch path. Only It is not yet the confirmation this waits on. @anandude, about the table above: the P15v, T420 and T14 reports tested Who checked it: reviewed by Claude Opus 5.5, with Codex Medium as the second opinion. Codex reread the diff at this head and found no defect. It agreed that neither new comment is the confirmation this waits on, and it pointed out that the coverage table mixes heads. Codex had my earlier comments in front of it, so its agreement is not independent. |
|
Re-tested at the current head omarchybot's steps above, 5 times, with the helper from its The new path (platform switch listed, no hci): I blocked So the T14 row in the table above now holds for Tested with help from Claude Code; every run was on my machine. |
|
Same head, @echennells's re-test is the second hardware report at this head, and the first to exercise the platform-switch-only path on a real machine. It replaces the T14 row's older One behaviour for the maintainer to know about, not a defect: in that platform-only case, Still waiting on: a run of the steps in my earlier comment by @DrakeMorrison (#7936) or @alhasapi (#12599), or a maintainer deciding that the two current-head reports are enough. Confirmation of a hardware fix has to come from the account that reported the bug or from a maintainer. Who checked it: reviewed by Claude Opus 5.5, with Codex Medium as the second opinion. Codex found no defect in the diff and agreed that the new report is not the confirmation this waits on. It raised the platform-only behaviour above. My earlier comments were in front of it, so its agreement is not independent. |
|
Confirming the fix on a ThinkPad T480 at Environment
Before (stock 4.0.6)Turning Bluetooth off from the bar runs
The only way back I found was Menu → Update → Hardware → Bluetooth. After (PR head, using the stock
|
| Step | tpacpi_bluetooth_sw |
hci0 |
Powered | is-on |
|---|---|---|---|---|
| off | unblocked | blocked | no | no |
| off, then USB re-enumeration* | unblocked | blocked | no | no |
| on | unblocked | unblocked | yes | yes |
| toggle → toggle | unblocked | blocked → unblocked | no → yes | no → yes |
| on, then USB re-enumeration* | unblocked | unblocked | yes | yes |
* Simulated by writing 0 then 1 to /sys/bus/usb/devices/1-7/authorized, which re-registers hci0 the same way resume from S3 does on this machine. systemd-rfkill restored the per-adapter state each time.
Result
With the PR:
- The adapter stays on the bus while Bluetooth is off.
- The bar widget stays visible with the "off" icon.
- The switch works in both directions.
Not tested
- Persistence across a full reboot.
Resolves the conflict with omacom#16334, which removed the AutoEnable source grep from the end of test/shell.d/bluetooth-test.sh where this branch appends its rfkill tests. The grep stays removed and this branch's tests are kept unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
This branch had started conflicting with The conflict: #16334 removed the source-text checks from What ran at @luismiguelfm's T480 report (Intel AX210, Still waiting on: @DrakeMorrison (#7936) or @alhasapi (#12599) to run the steps from my earlier comment, or a maintainer deciding the current-head reports from @robi42, @echennells and @luismiguelfm are enough. Because the helper hasn't changed, a run at Who checked it: Claude Opus 5.5 did the merge and the review. The second opinion came from Codex Medium and muse-wonder (via pi, thinking high). Both found the resolution correct and agreed that the tests kept are behaviour tests, not source checks. Neither found a defect in the change. They could read my earlier comments on this PR, so their agreement is not independent. |
|
This looks like the right root-cause fix: keeping One complementary data point. On a ThinkPad T14s Gen2i (AX210, Omarchy 4.0.6-1, kernel 7.2.8-9, bluez 5.87) the bar can avoid the platform switch entirely by using function toggleBluetooth() {
if (!adapter) {
Quickshell.execDetached(["omarchy-bluetooth-power", "on"])
return
}
Quickshell.execDetached(["bluetoothctl", "power", adapter.enabled ? "off" : "on"])
}Trade-off: I have been running that in a cloned widget (https://github.com/sl0vvman/omarchy-bluetooth-stay) across off/on cycles and the adapter stays on D-Bus. Not arguing against the hci-only block — just leaving the alternative and the #16210 angle in case it is useful. |
|
Status check — I think the gate this was waiting on is now met. The last review note said it was still waiting on a hardware confirmation from a reporter. Since then the thread has four independent positives, on three radio vendors:
@robi42, @echennells and @luismiguelfm all report the adapter surviving an off/on cycle from the bar, which is the behaviour this was written for. @sl0vvman adds that The branch is mergeable against Not asking for a re-review — just flagging that as far as I can tell nothing is outstanding from the reporter side. |
|
Works perfectly for me. Tested at f3d8136 on a ThinkPad P1 Gen 5, Intel AX211 (8087:0033), tpacpi_bluetooth_sw present, Omarchy 4.5.0-3, kernel 7.2.15, bluez 5.87. omarchy-bluetooth-power off blocked only hci0, tpacpi_bluetooth_sw stayed unblocked, the controller stayed registered at Powered: no, and there was no USB disconnect in the kernel log. on returned it to Powered: yes within a second. |
|
Can confirm this on a Dell laptop running Omarchy 4.5.0-3. Reproduction
Scoping the block to |
|
Same head as my last comment, @martincurkovic's P1 Gen 5 report is the first real-hardware test at this head. Only @anandude, about the status check: the T14s Gen2i row in your table is @sl0vvman's widget, which uses Linked: this pull request now also closes #15112 and #16501. Both describe this exact failure on ThinkPads: Still waiting on a hardware confirmation from someone who opened one of the issues this closes: @DrakeMorrison (#7936), @alhasapi (#12599), @madsclaussen (#15112) or @bhargavenu (#16501). The other option is a maintainer deciding that the four reports above are enough. To test, run this and reply with the output, quoting the full commit It works if Who checked it: Claude Opus 5.5 reviewed it. The second opinion came from Codex Medium and muse-wonder (via pi, thinking high). Both agreed that none of the new comments is a confirmation from a reporter, and that #15112 and #16501 have the cause this fixes. muse-wonder pointed out the #16501 side note and the T14s row in the table. Neither found a defect in the change. Both could read my earlier comments, so their agreement is not independent. |
|
Tested at commit Ran the test snippet: Results:
|
|
Same head as my last comment, @h45sh, thanks for running it on the Dell. It is the first test of this change on a One line doesn't show what it says: the command reads Still waiting on the same thing as before: a confirmation, using the snippet in my last comment, from someone who opened one of the issues this closes (#7936, #12599, #15112 or #16501), or a maintainer deciding that the five hardware reports so far are enough. Your test counts toward that decision, but it isn't one of those confirmations, since it doesn't come from one of those issues' openers. Who checked it: Claude Opus 5.5 read the new report against the helper at this head. The second opinion came from Codex Medium and muse-wonder (via pi, thinking high). Both found the output consistent with the change, both flagged the |
|
Here is the snippet with literal Confirmed that |
|
Tested on a ThinkPad X1 Carbon 7th, Omarchy 4.5.0-3, kernel 7.2.15-4-omarchy, Intel 9460/9560 Bluetooth ( Before (stock 4.5.0-3 helper): turning Bluetooth off from the panel soft-blocks With this PR at
|
|
#20378 already keeps the platform switch unblocked when an HCI adapter is listed. Thanks @thomasgraichen for testing that case at this PR's head on the X1 Carbon against stock 4.5.0-3. The remaining difference is in the fallback. Current quattro still attempts a type-wide block if the listing fails or contains only a platform switch. This PR stops on a listing error and leaves a lone platform switch untouched. #12585 handles recovery after detachment. GPT-6.2 Sol in Codex (high effort) compared the diffs and checked the passing GitHub checks at this head. Opus 5.5 High and muse-wonder via pi, thinking high agreed on the fallback behavior. Their independence is unverified. The branch conflicts with quattro in the helper and its tests. The maintainer can decide whether to carry the fallback changes forward, including whether off should report success when only the platform switch is present. |
Fixes #7936.
Problem
omarchy-bluetooth-power offrunsrfkill block bluetooth, a type-wide block (RFKILL_OP_CHANGE_ALL). On laptops that expose a platform Bluetooth rfkill switch next to the adapter's ownhci0switch (ThinkPads viathinkpad_acpi, Dells viadell-laptop, Ideapads, ...), that also blocks the platform switch — and the embedded controller answers by cutting USB power to the Bluetooth module.hci0disappears from the kernel entirely instead of goingPowered: no, so the panel loses its way back on. This is the root cause behind the "widget disappears" report in #6956 on this class of hardware, where the panel-side fixes (#7048, #7065) are insufficient on their own.Change
bin/omarchy-bluetooth-power: newblock_adapters()blocks only thehci*rfkill indexes (rfkill -n -o ID,DEVICE list bluetooth+awk), used by bothoffand the power-off half oftoggle. The per-adapter soft block still drops the adapter toPowered: no, and systemd-rfkill persists it under the adapter's own ID, so off survives a reboot the same way. With no HCI switch in sight (no radio, or an already-removed one) it falls back to the type-wide block, preserving the old behavior there.onstaysrfkill unblock bluetoothsince unblocking the platform switch is harmless.test/shell.d/bluetooth-test.sh: the mockrfkillnow answerslistfromMOCK_RFKILL_LIST(empty by default, so all legacy assertions keep exercising the fallback unchanged), plus 5 new tests: blocks only the HCI index, skips the type-wide block when adapters exist, never touches the platform switch, scoped toggle-off, and type-wide fallback without adapters.Verification
bash test/shell.d/bluetooth-test.sh: all pass, including the 5 new onesbash test/shell.d/bin-style-test.sh: pass./test/cli: 112 ok, 0 failures./test/shell: only the 5 pre-existing environment failures (missingomarchy-pkgscheckout,omasnap, Qt portal) — confirmed identical on the clean treehci0): the ID extraction yields just thehci0indexNote
Known limitation from the issue discussion: if the adapter is re-enumerated (e.g. suspend/resume), the new rfkill inherits the global type state, which a per-index block never sets — so a resumed adapter could come back unblocked. A udev rule re-applying the saved state would cover that; kept out of this PR to stay atomic. Happy to follow up if you want it here.
Fixes #12599
Fixes #15112
Fixes #16501