Repository navigation
Conversation
The Lenovo 82XQ only offers s2idle, and its Micron NVMe firmware rejects every I/O with Access Denied/DNR after resume, taking the root filesystem read-only mid-session. The failure presents as a black screen or a lock that never accepts a password, so it gets debugged as a compositor bug. On this model, write a logind drop-in that locks on lid close and on the suspend key instead of suspending: the session locks and the panel powers down, which is what a user expects from closing a laptop, and the filesystem stays alive. Written by the hardware install step and by a migration for existing installs. Fixes omacom#12887
Automated AI review
Verified: the drop-in is valid and reaches the right machines. On a LENOVO/ Four points are worth addressing: the migration can record itself as done without applying the fix, several suspend paths stay reachable, the docked-lid key works against Omarchy's clamshell design, and the test calls the real Migration is marked complete when
|
| Path | After this PR (source, systemd v262) |
|---|---|
| Lid close, undocked | lock, no suspend |
| Suspend key, short or long press | lock, no suspend |
System menu > Suspend (omarchy-menu.jsonc) |
runs systemctl suspend, still suspends |
Direct systemctl suspend (the issue's own reproduction) |
still suspends |
Hibernate key, default HandleHibernateKey=hibernate, hibernation not set up |
logind falls back to regular suspend |
Whether the 82XQ keyboard has a hibernate key was not verified.
Impact: an 82XQ user who picks Suspend from the System menu still hits the NVMe failure the PR is meant to prevent.
Suggested change: if the goal is that this model never suspends, a /etc/systemd/sleep.conf.d/ drop-in with [Sleep] AllowSuspend=no covers every row above in systemd v262. systemctl suspend then fails with "Sleep verb 'suspend' is disabled by config", and logind ignores suspend from the lid and keys, while hibernate stays available. The menu entry would still be shown unless it is hidden separately. If the narrower scope is intentional, rewording the comments to name the lid and suspend key would avoid overstating the protection.
HandleLidSwitchDocked=lock inverts the clamshell design
logind's default for HandleLidSwitchDocked is already ignore, so a docked lid close never suspended and this line adds no protection. bin/omarchy-system-lid-close states the intended policy: a docked lid close "does not suspend (HandleLidSwitchDocked defaults to ignore), so it must not lock either: that is clamshell mode".
logind's lock action only emits the org.freedesktop.login1.Session.Lock D-Bus signal. No listener for it was found in the Omarchy shell or Hyprland sources at this head, so today the docked setting has no visible effect. The visible lock and panel-off on an undocked lid close come from Omarchy's own Lid Switch binding (omarchy-system-lid-close → omarchy-system-lock), not from the drop-in. For the same reason, a suspend-key press now produces no visible lock.
Impact: any component that later honours logind's Lock signal would lock the external display in clamshell mode, against the policy above.
Suggested change: drop HandleLidSwitchDocked=lock from both scripts. The issue recommended that key for the hibernate workaround, where it is needed; for lock it is not.
Test calls the host's systemctl, and two assertions cannot fail
The first migration run uses a pass-through sudo stub (exec "$@") and no systemctl stub, so line 29 runs the real systemctl reload systemd-logind on the machine running ./test/shell. In an isolated run, a recording stub logged exactly that call. On a desktop this is expected to raise a polkit prompt (not observed live); as root it would reload logind. docs/testing.md asks tests not to touch the developer's machine.
Separately, the "idempotent once the drop-in exists" and "no-op on unmatched hardware" checks use a sudo stub that exits 1, but line 16's || exit 0 turns that into success. With the -f guard (line 14) or the DMI guards (lines 12-13) deleted in isolated mutation runs, the test still passed 6/6; the stub's "sudo must not run" message went to stderr unchecked. The [Login] header, HandleSuspendKeyLongPress and the reload are also never asserted.
Suggested change: add a logging systemctl stub to $tmp_dir/bin, make both stubs append their arguments to a call log (the pattern in docs/testing.md), and assert the log is empty for the rerun and unmatched cases and contains the reload for the first run. Fixing line 16 as suggested above would also make the current failing-stub checks fail as intended.
Review information
Test scope: Source review of the changed scripts, Omarchy's installer, migration, lid, lock, idle and menu paths at this head, and systemd v262 logind source (the version Arch currently packages). Isolated command-only runs with stubbed sudo, systemctl and helpers, synthetic DMI and logind config directories: the PR test on head and base, guard-removal mutations, the migration through the real omarchy-migrate runner, and the installer leaf through run_logged. No 82XQ hardware, live session, logind daemon or suspend/resume was tested. Whether every 82XQ SKU shares the reported drive fault was not assessed.
AI process: Opus 5.5 Medium coordination and synthesis, independent Opus 5.5 Xhigh and GPT 6 Sol Xhigh technical assessments, Opus 5.5 Medium editorial check.
Opt out: To stop receiving these reviews, reply to this comment saying so.
|
Thanks, both points addressed in 14dd521:
|
Automated AI review
Follow-up at
Verified:
The reply's statement that Migration is still marked complete when
|
| Case | migrate exit | Marker | Drop-in | --pending |
|---|---|---|---|---|
every sudo call fails |
0 | written | absent | nothing listed |
only sudo tee fails |
1 | none | absent | lists the migration |
| reload fails | 0 | written | present | nothing listed, no message |
|| exit 0 removed, sudo fails |
1 | none | absent | lists the migration |
Impact: on an affected 82XQ, one failed password prompt (for example from the login notifier or a manual omarchy-migrate) permanently skips the fix for that user. This conflicts with agents/skills/migrations.md line 129 ("A migration that cannot finish must exit non-zero, remain pending, and stop the queue"). During omarchy update, sudo is usually already authenticated by the package step, so that path is less likely to hit it.
Suggested change: drop || exit 0 from line 16. The current test still passes 6/6 with that change. For the reload, the pattern in migrations/1784970000.sh lines 18-25 applies: logind exposes HandleLidSwitch as a property, so the migration can compare it and set reboot-required on a mismatch.
Other suspend paths still reach suspend on the 82XQ
Nothing in this area changed. The drop-in covers only logind's lid and suspend-key handling. The System menu's Suspend entry (default/omarchy/omarchy-menu.jsonc line 38) still runs systemctl suspend, and systemctl suspend still suspends. In systemd v262, the hibernate key falls back to regular suspend when hibernation is not set up, and hibernation is opt-in in Omarchy. The code comments still say suspend "can never succeed on this model". Whether the 82XQ keyboard has a sleep or hibernate key was not verified.
Two open PRs would also bypass this drop-in on the 82XQ if they merge (from the PR diffs and systemd v262 source; not run):
| Open PR | Effect on an undocked 82XQ with this PR |
|---|---|
| #12210 (lid-close debounce) | Its lid helper runs systemctl suspend after about 3 s unless suspend-off is enabled, on battery and on AC |
| #12125 (lid sleep policy), hibernation set up | Its 99-omarchy-lid-sleep.conf sorts after 50-ideapad-suspend.conf: suspend-then-hibernate on battery, suspend on AC |
Impact: a user on an affected 82XQ who picks Suspend from the System menu still hits the NVMe failure the PR is meant to prevent. The same applies to lid close if either PR above merges, under the conditions in the table.
Suggested change: if the goal is that this model never suspends, a model-gated /etc/systemd/sleep.conf.d/ drop-in with [Sleep] AllowSuspend=no covers every path above, whatever the logind drop-in order:
- By default it also disallows suspend-then-hibernate and hybrid sleep. Hibernate stays available.
- logind ignores a disallowed lid or key action.
systemctl suspendfails with "Sleep verb 'suspend' is disabled by config".- The sleep config is re-read on every request, so this needs no logind reload.
- Setting
AllowSuspendThenHibernate=noandAllowHybridSleep=noexplicitly also overridessleep.confor an earlier-sorting drop-in that turns them on.
To also hide the menu entry, the migration (which runs per user) could set Omarchy's existing suspend-off toggle. If the narrower lid-and-key scope is intentional, rewording the comments would avoid overstating the protection.
Optional test improvement: the test checks the migration's drop-in only for HandleLidSwitch=lock (line 78). In mutation runs, removing [Login], HandleSuspendKey=lock or HandleSuspendKeyLongPress=lock from the migration's heredoc, or adding HandleLidSwitchDocked=lock there, still passed 6/6. The two heredocs are byte-identical today, but nothing enforces that. A cmp "$dropin" "$migration_dropin" would cover it. A failing-sudo case that expects a non-zero migration exit would lock in the fix above.
Open question, drive or model: issue #12887 documents one unit, with Micron MTFDKCD512QGN-1BN1AABLA firmware 1001V8LN, and attributes the fault to that drive's firmware. Lenovo's PSREF for the IdeaPad Slim 3 15AMN8 lists 128 GB to 1 TB SSD options in one M.2 slot, so this model ships with more than one drive. The PR gates on LENOVO/82XQ only. If the fault is drive-specific, unaffected 82XQ units lose lid-close suspend for no benefit. One report cannot settle whether it is. Reports from 82XQ units with other drives would. Options: also match /sys/class/nvme/nvme*/model (and optionally firmware_rev), or state the model-wide assumption in the comments.
Review information
Test scope: Follow-up of 14dd5215 against the earlier review at 1fdf5c45. Source review of the changed scripts, Omarchy's migration runner, installer logging, lid, menu and hibernation paths at this head, systemd v262 logind and sleep source, and open PRs #12125 and #12210 at their current heads. Isolated command-only runs with stubbed sudo, systemctl and helpers, and synthetic DMI and logind directories:
- the PR test on head, the previous head and the base, with a
PATHcanary - guard, content and reload mutations
- the migration through the real
omarchy-migrate - the installer leaf through
run_logged
The interactions with the open PRs are source-derived, not run. No 82XQ hardware, live logind daemon, reload or suspend/resume was tested.
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.
`|| exit 0` after `sudo install -d` turned a cancelled or failed password prompt into success, so omarchy-migrate wrote the completion marker without the drop-in and the fix never ran again for that user. Let -e stop it instead, as agents/skills/migrations.md asks, and test the refusal the way omarchy-migrate runs the script. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`|| true` let a failed reload pass silently: the drop-in was on disk, the migration was marked done, and logind kept suspending on lid close until the next boot. Set reboot-required instead, as migration 1784970000 does for its own logind drop-in, and assert the denied-sudo case actually reached sudo. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-Authored-By: Codex Medium <noreply@openai.com>
|
Reviewed at What was checked. The change was run on a disposable Omarchy VM (systemd 261). There, running the migration under Pushed to this branch, two commits:
Each commit comes with a test case, and each case fails with its fix reverted. On the second round, Codex found nothing further. Still open, for the author. For the maintainer. The drop-in covers the lid and the suspend key only. System menu → Suspend still runs @Chillbruhhh, could you confirm this on your 82XQ? Your confirmation is what this waits on.
Please reply here with what you saw. If the branch moves again, the confirmation needs to be against the new commit. |
|
|
|
||
| [[ -r $dmi/sys_vendor && -r $dmi/product_name ]] || exit 0 | ||
| [[ $(<"$dmi/sys_vendor") == "LENOVO" && $(<"$dmi/product_name") == "82XQ" ]] || exit 0 | ||
| [[ -f $dropin ]] && exit 0 |
There was a problem hiding this comment.
The migration treats any existing $dropin as a completed repair. If an update stops after sudo tee creates the file but before the reload or reboot notice, the next run exits here and records success without applying the settings. A failed write can also leave an empty or incomplete file that gets skipped forever.
Check the required contents and finish the reload or reboot notice on retries. Write through a temporary file followed by a rename so a failed write cannot leave a partial repair.
Knowledge Base Used: Migration framework
Co-Authored-By: Saurabh Suri <suritech@gmail.com>
|
Re-reviewed at What was checked. The tests ran on a disposable Omarchy VM (systemd 261). Running the migration under Greptile's retry finding holds, but it is unlikely to happen. For the maintainer, unchanged from the last review: the drop-in covers the lid and the suspend key only. System menu → Suspend and a plain @Chillbruhhh, could you confirm this commit on your 82XQ? This is what the pull request waits on.
Please reply here with what you saw. |
|
I'm the reporter of #12887. Tested
So it does what it says: closing the lid no longer takes the drive down. To be clear about the trade-off, though, the machine never sleeps now, so a closed lid keeps draining the battery at near-idle rate instead of s2idle rate. Two requests:
|
|
Thanks @Chillbruhhh, that is the test this was waiting on. Read by Claude Opus 5.5 and, as a second opinion, Codex Medium. The head is still One thing before this counts as verified. Your reply names the commit as On For the maintainer, unchanged: System menu → Suspend and a plain This now waits on your full-SHA reply, and then on the maintainer. |
Summary
On the IdeaPad Slim 3 15AMN8 (Lenovo
82XQ),s2idleis the only sleep state and the Micron NVMe firmware rejects all I/O withAccess Denied (sct 0x2 / sc 0x86) DNR~0.5 s after resume — btrfs remounts root read-only, and the machine needs a hard power cycle. The failure presents as a black screen or a lock screen that never accepts a password (PAM can't read the disk), so it gets debugged as a compositor bug.Per the reporter's suggested fallback:
HandleLidSwitch=lockis strictly better thanignore— the session locks and the panel powers down (what a user expects from closing a laptop) while the filesystem stays alive. Hibernate was considered but the reporter's own attempt cold-booted on tight swap, solockis the safe default.install/hardware/fix-ideapad-suspend.shwrites/etc/systemd/logind.conf.d/50-ideapad-suspend.confonly when DMI identifiesLENOVO/82XQ, registered ininstall/hardware/all.shOMARCHY_DMI_PATH/OMARCHY_LOGIND_CONF_DIRfor testingFixes #12887
Test plan
test/shell.d/ideapad-suspend-test.sh: drop-in written on matching DMI, untouched on other models, migration applies it once and no-ops on repeat/unmatched runs (6 assertions, all passing)Generated with Devin