Skip to content

Offer the reboot after a channel switch - #13544

Closed
stevederico wants to merge 4 commits into
omacom:quattrofrom
stevederico:fix/channel-switch-reboot-offer
Closed

stevederico wants to merge 4 commits into
omacom:quattrofrom
stevederico:fix/channel-switch-reboot-offer

Conversation

@stevederico

@stevederico stevederico commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

After a channel switch, Omarchy says "Run omarchy-system-reboot when ready." instead of offering the reboot the new kernel needs. This brings the offer back. Fixes #13416

Before: omarchy-channel-set hands off with omarchy update -y, which also marks the update unattended, so confirm_reboot only prints the hint.
After: new omarchy update --confirmed skips only "Ready to update?". The channel switch uses it when stdin and stderr are terminals, and -y otherwise, so a scripted switch never waits on the reboot prompt. -y is unchanged. Older destinations (stable 4.0.4) ignore the flag and ask "Ready to update?" once more.

How I tested

  • bash test/shell.d/update-sequence-test.sh and bash test/shell.d/channel-test.sh pass. Both fail with the fix reverted
  • TODO: a real channel switch from the menu

#13444 adds --skip-confirm and always passes it, so a scripted switch can hang on the reboot prompt. #13616 drops -y on a terminal and asks "Ready to update?" twice.

@llstrk

llstrk commented Sep 29, 2026

Copy link
Copy Markdown

Automated AI review

Community review: Independent automated community review, unaffiliated with the Omarchy team, intended to help prepare PRs for their review.

Outcome: docs/update-process.md was not updated for the new --confirmed flag; no defects were found in the code change itself.

docs/update-process.md does not document --confirmed

The pipeline diagram still says confirm unless -y (line 128), and the flag notes describe only -y (line 161). Impact: the reference doc no longer lists every way the confirmation is skipped, and does not say that only -y sets OMARCHY_UPDATE_UNATTENDED and so suppresses the reboot offer.

Suggested change: add --confirmed at both places and note that, unlike -y, it keeps the reboot offer and the package-conflict handoff interactive.

Optional notes

Optional test improvement: the new check grep -q '^omarchy-update-restart unattended=$' matches either restart call (--services-only or --reboot-only), so a mutation that marks only the reboot phase unattended still passes (reproducer below). Suggested change: assert on the last omarchy-update-restart line, which is the reboot phase.

Reproducer for the optional test note (mutation survives at f6f8b91)

The new --confirmed check in test/shell.d/update-sequence-test.sh looks for any line matching ^omarchy-update-restart unattended=$. omarchy-update calls omarchy-update-restart twice (--services-only, then --reboot-only), and the step stub does not record which phase it is. Only the second call offers the reboot. So a change that marks just the reboot phase unattended still passes.

Mutation applied to bin/omarchy-update at f6f8b91:

@@ -159,5 +159,6 @@
   omarchy-update-stay-awake stop
   update_stay_awake_stopped=1
 
+  [[ ${1:-} != "--confirmed" ]] || export OMARCHY_UPDATE_UNATTENDED=1
   "$OMARCHY_PATH/bin/omarchy-update-restart" --reboot-only
 fi

bash test/shell.d/update-sequence-test.sh with that mutation (exit 0):

ok - an update where every step works runs all of them, in order
ok - -y is what marks an update unattended, not the update itself
ok - --confirmed skips the update question but keeps the reboot offer
ok - a blocked package upgrade stops the update before it migrates

A stricter form of the assertion checks the last restart call, which is the reboot phase:

@@ -97,7 +97,7 @@
 run_update --confirmed </dev/null || fail "an update confirmed by its caller reports a failure"
 diff <(expected_steps) <(steps_run) >"$test_tmp/order" ||
   fail "--confirmed still asks the person to confirm the update" "$(cat "$test_tmp/order")"
-grep -q '^omarchy-update-restart unattended=$' "$test_tmp/steps" ||
+[[ $(grep '^omarchy-update-restart ' "$test_tmp/steps" | tail -n 1) == "omarchy-update-restart unattended=" ]] ||
   fail "--confirmed marks the update unattended, so the reboot offer is skipped"
 pass "--confirmed skips the update question but keeps the reboot offer"

With the stricter assertion and the mutation (exit 1):

ok - an update where every step works runs all of them, in order
ok - -y is what marks an update unattended, not the update itself
not ok - --confirmed marks the update unattended, so the reboot offer is skipped

With the stricter assertion at f6f8b91, unmutated (exit 0):

ok - an update where every step works runs all of them, in order
ok - -y is what marks an update unattended, not the update itself
ok - --confirmed skips the update question but keeps the reboot offer
ok - a blocked package upgrade stops the update before it migrates
Details

Verified (sandboxed repository fixtures at f6f8b91):

  • A real omarchy-channel-set stable → omarchy-update → omarchy-update-restart chain with a reboot-required marker shows the gum confirm reboot prompt at head, never calls omarchy-update-confirm, and ends with sudo revoked. At the merge-base it prints the "Run omarchy-system-reboot when ready." hint instead.
  • --confirmed survives the script logging and lock re-execs; omarchy update --confirmed and omarchy up --confirmed reach omarchy-update with that argument.
  • -y still skips the confirmation and sets OMARCHY_UPDATE_UNATTENDED=1 on both restart phases.
  • The new update-sequence-test.sh check and the updated channel-test.sh expectations pass at head and fail against the merge-base scripts.

Older destinations: an updater that already has the no-update sudo wrapper but predates this flag (for example an unpulled ~/omarchy dev checkout) treats --confirmed as an unknown argument and asks "Ready to update?" once, as the PR body says. If that question is declined, omarchy-channel-set exits 0 after the refresh and package swap, without migrations or the reboot offer. With -y that updater always ran. This path is transitional and user-initiated.

Package-conflict handoff: omarchy-update-system-pkgs-when-conflicted also reads OMARCHY_UPDATE_UNATTENDED, so a package conflict that reaches the update's own package step during a channel switch now re-runs pacman interactively instead of exiting with a hint. This is rare in a switch, since its refresh already ran pacman -Syyuu --noconfirm (source reading, not executed). The new code comment intends this; the PR body does not mention it.

Related PRs: #13444 (--skip-confirm) edits the same lines of bin/omarchy-update and bin/omarchy-channel-set, so only one of the two can merge as is. #13616 (runs omarchy-update without -y on a TTY) also targets #13416, but is based on an older omarchy-channel-set and currently shows merge conflicts.


Review information

Test scope: Source review and sandboxed repository tests with stubbed sudo, pacman, gum and reboot, at f6f8b91; not run on a real system.

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.

@omarchybot omarchybot added the enhancement New feature or request label Oct 1, 2026
@greptile-apps

greptile-apps Bot commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; terminal switches regain the reboot offer while other switches keep unattended mode.

Summary

This PR separates approval to start an update from unattended mode.

  • Channel switches offer a reboot after a needed update.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Channel packages switched] --> B{Input and errors use terminals?}
  B -->|Yes| C[Run update with --confirmed]
  B -->|No| D[Run update with -y]
  C --> E[Skip opening question; keep later prompts]
  D --> F[Skip Omarchy prompts]
  E --> G[Complete update and check boot files]
  F --> G
  G --> H{Boot checks pass and reboot needed?}
  H -->|Yes, interactive| I[Offer reboot]
  H -->|Yes, unattended| J[Print reboot command]
  H -->|Boot checks fail| K[Report failure; do not offer reboot]
Loading

Reviews (6) · Last reviewed commit: "Note that older channels ask to update t..." · Reviewed by Greptile

Comment thread bin/omarchy-channel-set Resolved
@jandrusk

jandrusk commented Oct 7, 2026

Copy link
Copy Markdown

This now conflicts with quattro, probably because of today's change to bin/omarchy-update (#14428). Could you rebase it? #13444 makes the same fix with --skip-confirm, so the maintainers will pick one, and that's easier if both merge cleanly. #13416 is still open on quattro (omarchy-channel-set still hands off with -y), so the fix is still needed.

@stevederico
stevederico force-pushed the fix/channel-switch-reboot-offer branch from 7054b10 to 9f04794 Compare October 7, 2026 17:02
@stevederico

Copy link
Copy Markdown
Contributor Author

Rebased on quattro, tests pass.

@jandrusk

jandrusk commented Oct 8, 2026

Copy link
Copy Markdown

Thanks for the rebase. Choosing --confirmed only when stdin and stderr are terminals (and -y otherwise) is a nice refinement, and both paths are tested.

One heads-up, same as on #13444: omarchy-channel-set execs the destination's omarchy-update, and stable 4.0.4 doesn't know --confirmed. So an edge → stable switch will ask "Ready to update?" a second time. As @Bartok9 argued there, that's better than silently going unattended, but a one-line comment in omarchy-channel-set noting it would help. Both PRs now merge cleanly, so it's down to the maintainers to pick one.

@stevederico

Copy link
Copy Markdown
Contributor Author

@jandrusk Good catch, added a comment in omarchy-channel-set noting that older destinations like stable 4.0.4 ignore --confirmed and will ask once more.

@omarchybot

Copy link
Copy Markdown
Collaborator

This pull request still applies to quattro at cb6c400 and does what its description says. omarchy update --confirmed skips only the "Ready to update?" question. omarchy-channel-set passes it when stdin and stderr are both terminals and keeps passing -y otherwise, so a channel switch run from the menu offers the reboot again and a scripted switch still cannot hang on that offer. I checked this by reading the source and the new tests. Nothing was run on a worker this pass, so the change carries no verified label.

The classification is unsettled. I read it as a bug fix, because it fixes #13416: on quattro the menu's channel switch drops the reboot offer when it hands off with -y. Codex Medium, which classified the item separately, read it as an enhancement, because it adds a new --confirmed option to omarchy update. When the two classifications disagree, the item gets no class label, so the enhancement label from an earlier pass has been removed. The maintainer settles the class, and the full review and worker run follow once they have.

Two other open pull requests fix #13416. #13444, which is older, adds --skip-confirm and always passes it. #13616 drops -y when stdin is a terminal. Choosing between them is the maintainer's decision. Nothing is needed from the author at this point.

@paulogeyer

Copy link
Copy Markdown
Contributor

Compared the PRs for omarchy-channel-set never offering the reboot after a channel switch because it hardcodes omarchy-update -y (#13416). Mostly code review: omarchy-update runs under bash -p, script and the update lock, so I only ran #13544's own channel test (34 pass on the PR, the new terminal case fails on stock).

PR Reboot offered from the menu Non-interactive callers stay unattended Asks "Ready to update?" twice
#13544 yes (--confirmed on a tty) yes (-y without a tty) no (old stable asks again, documented)
#13444 yes (--skip-confirm) no tty check no
#13616 yes (plain omarchy-update on a tty) yes yes

#13544 is the one to merge: it keeps -y for non-interactive runs, skips only the second confirm, and has a test. #13444 and #13616 are duplicates of it. #13616 also sources omarchy-sudo-keepalive, which goes against the sudo revoke/re-authorize design in omarchy-channel-set; #13415 has its own PR (#13479).

Suggestion: add Fixes #13416 to the #13544 description.

@stevederico
stevederico force-pushed the fix/channel-switch-reboot-offer branch from cb6c400 to 0d7051e Compare October 29, 2026 16:59
omarchy-channel-set handed off to omarchy update -y. -y skips the "Ready
to update?" question but also marks the update unattended, which replaces
the reboot offer with a line of text. A channel switch runs in a terminal
someone is watching and usually swaps the kernel, so the reboot choice
was lost exactly when it mattered.

Add omarchy update --confirmed: it skips only the update question, for a
caller that already asked it. The channel switch uses it, so the reboot
offer comes back. -y is unchanged.

Fixes omacom#13416
docs/update-process.md now lists --confirmed next to -y and says that,
unlike -y, it keeps the reboot offer and the conflict handoff
interactive. The update-sequence test checks the last
omarchy-update-restart call, the reboot phase, so a change that marks
only that phase unattended no longer passes.
--confirmed keeps the reboot offer, which waits on gum confirm. A switch
run by a script, with passwordless sudo and an open stdin, had nobody to
answer it and could wait forever after the packages had already changed.
The switch now passes --confirmed only when stdin and stderr are
terminals, the same check the package-conflict step uses, and -y
otherwise. The channel test runs the switch both ways: without a
terminal, and inside one from script.
@stevederico
stevederico force-pushed the fix/channel-switch-reboot-offer branch from 0d7051e to 9e6277f Compare October 31, 2026 19:45
@omarchybot

Copy link
Copy Markdown
Collaborator

Since the last review here, quattro has merged #17251 (5fa15f2), which fixes #13416 another way. omarchy-update -y now keeps an OMARCHY_UPDATE_UNATTENDED the caller has already set, and omarchy-channel-set hands off with OMARCHY_UPDATE_UNATTENDED=0 omarchy-update -y. So on quattro a channel switch run from the menu offers the reboot again. I checked this by reading both diffs against the current quattro. Codex Medium, given the two diffs separately, came to the same conclusion. Nothing was run on a worker.

Because of that change, this pull request now conflicts with quattro in bin/omarchy-channel-set. bin/omarchy-update still merges cleanly. Here is what it would still add on top of quattro:

  • A terminal check. Without a terminal on stdin and stderr it still hands off with -y and runs unattended. quattro always sets OMARCHY_UPDATE_UNATTENDED=0, so a switch run without a terminal would reach gum confirm when a reboot is needed. Nobody has checked whether that fails, waits or finds a terminal, so for now this is a difference in design, not a confirmed defect.
  • An omarchy update --confirmed flag, with documentation for it, which quattro does not need for the menu path.
  • Tests for both the terminal and the non-terminal handoff.

The classification is still unsettled at this head. I read it as a bug fix, and Codex Medium, classifying it separately, read it as an enhancement. So it carries no class label. #13444 has since been closed, and #13616 is still open.

Next step: the maintainer decides whether the terminal check is worth keeping on top of #17251. If it is, this branch needs bin/omarchy-channel-set rebased onto the new handoff. If not, #17251 has already covered what this pull request was for. The author doesn't need to do anything until that decision is made.

@stevederico

Copy link
Copy Markdown
Contributor Author

Closing, since #17251 brings the reboot prompt back after a channel switch.

@stevederico stevederico closed this Nov 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

omarchy-channel-set suppresses the post-switch reboot offer because it hardcodes omarchy-update -y

5 participants