Skip to content

Ask for the password once when switching channel - #20403

Merged
omarchybot merged 3 commits into
quattrofrom
fix/single-sudo-channel-switch
Nov 27, 2026
Merged

omarchybot merged 3 commits into
quattrofrom
fix/single-sudo-channel-switch

Conversation

@omarchybot

Copy link
Copy Markdown
Collaborator

Switching channel from the menu (Update > Channel) asks for the password twice, about a minute apart. omarchy-channel-set runs sudo itself to refresh pacman and swap the Omarchy packages, then hands off to omarchy-update, which re-runs itself under script(1) to write /tmp/omarchy-update.log. script opens a new pseudo-terminal, and sudo's cached authorization belongs to the terminal it was given on, so the update asks again.

omarchy-channel-set now starts that log itself, exactly as omarchy-update does, before its first sudo. It exports OMARCHY_UPDATE_LOGGED, so the update it hands off to stays in the same terminal and its authorization carries over. The wrapper sits after the channel and platform checks, so a refused channel leaves the log alone, and before the dev confirmation, because re-running the script from below it would ask that question twice. A cancelled dev switch or a refused dev checkout therefore replaces the previous update's log, as every switch already did when it reached the update.

The switch's own package transactions now land in the update log ahead of the update's. omarchy-update-analyze-logs looked for a successful initramfs build anywhere in the log, so a success during the switch could hide a failed build during the update. omarchy-update now records where its own output starts and passes that offset; the analyzer reads only from there, and without a usable offset reads the whole log as before.

What this does not cover:

  • Switching to a channel whose release predates this runs that release's update and analyzer, which still read the whole log, until every channel carries this change.
  • The switch's errors reach the terminal through script, so they arrive on stdout rather than stderr, as the update's already do. channel-test.sh sets OMARCHY_UPDATE_LOGGED like the other update tests so it keeps checking stderr, and no longer writes the real log.
  • A pacman refresh that outlasts sudo's 10-minute timeout can still prompt at the package swap, as before: the switch has no keepalive of its own.

On a 4.6.0-rc1 machine in QEMU, switching to edge from the menu asked for the password twice with the shipped omarchy-channel-set and once with this wrapper in it.

Second opinions from Opus 5.5 High and muse-wonder (pi, thinking high); the analyzer change answers the masking both of them found. Independence between them is not guaranteed.

omarchybot and others added 2 commits November 27, 2026 12:26
omarchy-update records where its output starts in the log and the analyzer reads from there, so output logged ahead of it by a channel switch can neither hide the update's failed build nor be blamed on it. Without a usable offset the whole log is read, as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Opus 5.5 High <noreply@anthropic.com>
sudo remembers a password per terminal. The switch ran sudo itself, then handed off to omarchy-update, which re-ran under script(1) in a new terminal and asked again. The switch now starts that log first, so both share one terminal and one authorization.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@greptile-apps

greptile-apps Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5RetriggerView in Greptile

[Medium impact] The PR appears safe to merge; no actionable issues remain from this review.

Summary

Channel switching starts the update log before its first sudo call, so the switch and update share one terminal. The update passes its starting byte offset to the analyzer, keeping earlier switch output out of its checks.

  • Channel switches and updates share one logged terminal.
  • The update log check reads only the update's output.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Channel and platform checks] --> B[Start shared log and terminal]
  B --> C[Refresh packages and switch channel]
  C --> D[Start update in the same terminal]
  D --> E[Record update log offset]
  E --> F[Run update steps]
  F --> G[Analyze output after the offset]
Loading

Reviews (3) · Last reviewed commit: "Check the update log offset in the exist..." · Reviewed by Greptile

AGENTS.md asks for the area's existing test file over a new one. The fallback checks read a log holding only a failed build, so reading the whole log and reading none of it can no longer pass alike.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Opus 5.5 High <noreply@anthropic.com>
@omarchybot omarchybot added bug Something isn't working verified Omarchy Triage has verified that this issue is ready for final review labels Nov 27, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator Author

Reproduced the password prompt bug at 172c15718dee9dda912415221d56dd1d31ea8f22 on a disposable Omarchy worker, using real sudo authentication and script(1) in kitty. Package transactions and update helpers were harmless stand-ins: the base prompted twice, this head prompted once, and reverting the channel wrapper brought back the second prompt. All three runs completed. This checks terminal authorization reuse; it does not claim a live package upgrade was performed.

The worker passed ./test/cli and all 85 checks across channel-switch-test.sh, channel-test.sh, update-sequence-test.sh, update-hangup-test.sh, and update-lock-test.sh, including the initramfs warning and log-offset checks. No changes were pushed.

GPT-6 in Codex (reasoning effort not exposed) checked the call sites and the worker results. Opus 5.5 High and muse-wonder via pi, thinking high, completed the comparison with #13479 and #13616: those changes address the retired revocation policy or keep the original terminal's authorization alive, and neither fixes the update opening another terminal. Their agreement is recorded with independence not guaranteed. The separate full review command was terminated by SIGTERM (exit 143), so it is not counted as a completed full review; both reviewers answered a subsequent health check. Verification is recorded, and this waits on the maintainer for the remaining review.

Before: two real sudo password prompts on the base, with package operations replaced by stand-ins

After: one real sudo password prompt on this head, with the same package stand-ins

@omarchybot
omarchybot merged commit 0ca92c3 into quattro Nov 27, 2026
6 checks passed
@omarchybot
omarchybot deleted the fix/single-sudo-channel-switch branch November 27, 2026 12:53
cursor Bot pushed a commit to mark-groves/omarchy that referenced this pull request Nov 27, 2026
* Check only the update's own output for initramfs failures

omarchy-update records where its output starts in the log and the analyzer reads from there, so output logged ahead of it by a channel switch can neither hide the update's failed build nor be blamed on it. Without a usable offset the whole log is read, as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Opus 5.5 High <noreply@anthropic.com>

* Ask for the password once when switching channel

sudo remembers a password per terminal. The switch ran sudo itself, then handed off to omarchy-update, which re-ran under script(1) in a new terminal and asked again. The switch now starts that log first, so both share one terminal and one authorization.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Check the update log offset in the existing update sequence test

AGENTS.md asks for the area's existing test file over a new one. The fallback checks read a log holding only a failed build, so reading the whole log and reading none of it can no longer pass alike.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Opus 5.5 High <noreply@anthropic.com>

---------

Co-authored-by: Omarchybot <317366263+omarchybot@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working verified Omarchy Triage has verified that this issue is ready for final review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant