You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The power-guard daemon validates its timing overrides at startup and exits with status 2 on an invalid value (timing_from_env in nixos/services/power-guard/power-guard.py — the only SystemExit(2) source in the daemon), specifically so a misconfigured unit "shows as failed instead of crash-looping" (docstring, #6477). But the NixOS service in nixos/services/power-guard/default.nix sets Restart = "always" with RestartSec = "10s" and no RestartPreventExitStatus, so an invalid override actually crash-loops the unit every 10 seconds forever, repeating the startup error — the opposite of the intended end state.
Found by CodeRabbit review on PR #6485 (comment 4491161487); deliberately not folded into that PR because task 10951's packet keeps NixOS service configuration out of scope.
Fix
Add RestartPreventExitStatus = 2; to serviceConfig in nixos/services/power-guard/default.nix, so the invalid-override exit leaves the unit failed.
Acceptance criteria
default.nix serviceConfig includes RestartPreventExitStatus = 2.
Verified safe: exit status 2 in the daemon arises only from the invalid-timing path (grep SystemExit — one site, timing_from_env); normal operation and other exits are unaffected.
The power-guard test suite (scripts-test / test_power_guard.py) still passes; if a Nix-level check exists for the module, it passes too.
nixos/services/power-guard/default.nix serviceConfig (lines 33–37) sets Restart = "always" and RestartSec = "10s" with no RestartPreventExitStatus — an invalid timing override crash-loops every 10s forever.
power-guard.py: the only SystemExit site in the daemon is timing_from_env (line 85, raise SystemExit(2)), whose docstring states the intent that the unit "shows as failed instead of crash-looping"; main() returns no numeric code, so exit status 2 arises only from the invalid-timing path — adding RestartPreventExitStatus = 2 is safe for normal operation.
agent-note:v1
task 11031 parked: PR #6517 opened (branch queue/11031-6502-power-guard-restart-prevent, commit 18c28ed) with the one-line RestartPreventExitStatus = 2; fix. Targeted tests pass (unittest suite: 8 tests OK; nix parse OK). CI (basic: scripts-test 3.12/3.14) still pending after the 5-minute poll window, so task 11031 is parked 1200s; on resume, recheck PR #6517 checks and merge when green.
Expectation: done = claimant launches the bound opencode session and drives task 11117 to a terminal state (fix path scoped for the power-guard RestartPreventExitStatus=2 change, or closed with evidence if already handled).
agent-note:v1
task 11031 done (fixed_merged): PR #6517 merged 2026-11-06T14:00:04Z (merge commit d87538f) — one-line change adding RestartPreventExitStatus = 2; to serviceConfig in nixos/services/power-guard/default.nix, closing issue #6502. Verification: diff verified fresh (exactly the intended line); targeted tests passed on laptop (python3 -m unittest power-guard suite — 8 tests OK; nix-instantiate --parse default.nix OK). CI note: PR checks (basic: scripts-test 3.12/3.14, run 42225883557) sat queued/unstarted ~30 min (runner backlog, no failure); merged under Drew's merge authority (verified work does not wait on queued CI) — main-branch CI will exercise the change. Codex gate: Codex review failed on usage limits with zero inline findings — nothing to disposition.
Issue #6502 was closed 2026-11-06T14:00:06Z by PR #6517 merged 2026-11-06T14:00:04Z (merge commit d87538f) under task 11031 — the one-line RestartPreventExitStatus = 2; fix, verified in that task's closing note (targeted unittest suite 8 tests OK; nix parse OK). This triage task (task 11117) therefore completes as already_done/superseded with no new work.
Activity
developing-today commentedon Nov 6, 2026
CODE-1963
dezren39 commentedon Nov 6, 2026
🤖 Agent note · done
nixos/services/power-guard/default.nixserviceConfig (lines 33–37) setsRestart = "always"andRestartSec = "10s"with noRestartPreventExitStatus— an invalid timing override crash-loops every 10s forever.power-guard.py: the onlySystemExitsite in the daemon istiming_from_env(line 85,raise SystemExit(2)), whose docstring states the intent that the unit "shows as failed instead of crash-looping";main()returns no numeric code, so exit status 2 arises only from the invalid-timing path — addingRestartPreventExitStatus = 2is safe for normal operation.default.nixchange + power-guard test suite verification); issue power-guard: invalid timing override crash-loops under Restart=always — add RestartPreventExitStatus=2 #6502 stays open for that task.dezren39 commentedon Nov 6, 2026
🤖 Agent note · handed off
opencode, so task 11117 is handed off to the opencode claimant per the worker instruction §1b and parked 1200s pending the claimant launching the bound session; if the park expires first, task 11117 returns to the queue. Note for the claimant: issue power-guard: invalid timing override crash-loops under Restart=always — add RestartPreventExitStatus=2 #6502 was already triaged CONFIRMED by task 11029 (findings note on this issue) with a follow-up fix enqueued as task 11031 — resume from that state rather than re-triaging from scratch.5 remaining items
dezren39 commentedon Nov 6, 2026
agent-note:v1
task 11031 parked: PR #6517 opened (branch queue/11031-6502-power-guard-restart-prevent, commit 18c28ed) with the one-line RestartPreventExitStatus = 2; fix. Targeted tests pass (unittest suite: 8 tests OK; nix parse OK). CI (basic: scripts-test 3.12/3.14) still pending after the 5-minute poll window, so task 11031 is parked 1200s; on resume, recheck PR #6517 checks and merge when green.
dezren39 commentedon Nov 6, 2026
🤖 Agent note · handed off
dezren39 commentedon Nov 6, 2026
agent-note:v1
task 11031 done (fixed_merged): PR #6517 merged 2026-11-06T14:00:04Z (merge commit d87538f) — one-line change adding RestartPreventExitStatus = 2; to serviceConfig in nixos/services/power-guard/default.nix, closing issue #6502. Verification: diff verified fresh (exactly the intended line); targeted tests passed on laptop (python3 -m unittest power-guard suite — 8 tests OK; nix-instantiate --parse default.nix OK). CI note: PR checks (basic: scripts-test 3.12/3.14, run 42225883557) sat queued/unstarted ~30 min (runner backlog, no failure); merged under Drew's merge authority (verified work does not wait on queued CI) — main-branch CI will exercise the change. Codex gate: Codex review failed on usage limits with zero inline findings — nothing to disposition.
dezren39 commentedon Nov 6, 2026
🤖 Agent note · done
Issue #6502 was closed 2026-11-06T14:00:06Z by PR #6517 merged 2026-11-06T14:00:04Z (merge commit d87538f) under task 11031 — the one-line
RestartPreventExitStatus = 2;fix, verified in that task's closing note (targeted unittest suite 8 tests OK; nix parse OK). This triage task (task 11117) therefore completes asalready_done/supersededwith no new work.