Skip to content

Skip orphan gum confirm when omarchy-update runs unattended - #13617

Closed
AnPod wants to merge 2 commits into
omacom:quattrofrom
AnPod:cursor/fix-orphan-unattended-e0d3
Closed

AnPod wants to merge 2 commits into
omacom:quattrofrom
AnPod:cursor/fix-orphan-unattended-e0d3

Conversation

@AnPod

@AnPod AnPod commented Sep 28, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes #13356

omarchy-update -y hung on gum confirm in omarchy-update-orphan-pkgs whenever stdin/stdout were TTYs, because the helper ignored OMARCHY_UPDATE_UNATTENDED.

Change

  • Treat unattended updates like the non-TTY path: report orphans and exit without prompting
  • Cover with test/shell.d/update-orphan-unattended-test.sh (including a TTY/script case)

Test plan

  • bash test/shell.d/update-orphan-unattended-test.sh

cursoragent and others added 2 commits September 29, 2026 21:08
OMARCHY_UPDATE_UNATTENDED/-y must not hang on gum confirm for orphans
on a TTY (omacom#13356).

Co-authored-by: AnPod <AnPod@users.noreply.github.com>
Co-authored-by: AnPod <AnPod@users.noreply.github.com>
@cursor
cursor Bot force-pushed the cursor/fix-orphan-unattended-e0d3 branch from 772c22c to 8dd14ca Compare September 29, 2026 21:08
@omarchybot omarchybot added the bug Something isn't working label Oct 1, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

Thanks for picking up #13356. #8824 is an older open pull request against quattro that fixes the same bug, and of the two it is the one I would put in front of the maintainer. This PR stays open, and choosing between them is the maintainer's call.

What was checked. I read both diffs against current quattro (a85e29ab). There, bin/omarchy-update-orphan-pkgs still guards gum confirm with only ! -t 0 || ! -t 1, and bin/omarchy-update still exports OMARCHY_UPDATE_UNATTENDED=1 for -y before it runs the orphan step inside its script PTY, so the hang is real and both PRs address its cause. I did not run this branch on a worker, because it competes with a fix already reproduced and verified there.

Why #8824.

  • bin/omarchy-update-orphan-pkgs:17 here tests -n ${OMARCHY_UPDATE_UNATTENDED:-}, so OMARCHY_UPDATE_UNATTENDED=0 would also skip the interactive orphan review. bin/omarchy-update-system-pkgs-when-conflicted:74 and bin/omarchy-update-restart:14 both treat only 1 as unattended, and Skip orphan prompt during unattended updates #8824 uses that same == 1 check.
  • Skip orphan prompt during unattended updates #8824 adds its case to the existing test/shell.d/update-orphan-test.sh, reusing that file's stubs (including a sudo stub) and running under script like the update does. This PR adds a second test file with its own Python PTY harness and a grep for the variable name in the source, which proves only that the name is there.

Both tests do guard the fix: each fails if gum is called on a terminal with the flag set.

Second opinion. Codex Medium compared the two PRs without being given my answer and chose #8824 for the same two reasons. It found no defect in #8824. It also ran a stubbed check showing that the base calls gum, that both fixes skip it with 1, and that only this PR also skips it with 0.

What happens next. This waits on the maintainer to choose between the two.

@jandrusk

jandrusk commented Oct 7, 2026

Copy link
Copy Markdown

I think #14428, merged earlier today, has overtaken this. omarchy-update now always calls omarchy-update-orphan-pkgs -y and removes orphans through omarchy-pkg-drop, so the gum confirm this PR guards never runs during an update, with or without -y. The branch also conflicts with quattro now. Unless I'm missing a path that still prompts, I'd suggest closing this (and #8824, which now conflicts with quattro too) with #13356 resolved by #14428.

@omarchybot

Copy link
Copy Markdown
Collaborator

@jandrusk is right: #14428, merged into quattro today, has overtaken this, and I'd recommend closing it with #13356 resolved by #14428.

What was checked. I read current quattro (0a55a3c5) for every caller of omarchy-update-orphan-pkgs. The only one outside tests is bin/omarchy-update:130, which now always passes -y, and bin/omarchy-update-orphan-pkgs:23 skips gum confirm whenever the first argument is -y, terminal or not. Nothing in migrations/ or install/ calls it. So omarchy-update -y can no longer reach the prompt that hung in #13356. Run on its own in a terminal, the helper still asks before removing anything, which is what it is meant to do there. Nothing was run on a worker, since there is no longer a bug on quattro to reproduce.

What this branch would do now. It no longer applies: it conflicts with quattro at the guard #14428 rewrote. Carrying its check across as written would also undo #14428, because omarchy-update -y exports OMARCHY_UPDATE_UNATTENDED=1 (bin/omarchy-update:103) and this guard exits before removal whenever that variable is set, so orphans would be listed and never removed during an unattended update.

Second opinion. Codex Medium was asked whether the bug is still reachable on quattro, without being given my answer. It traced the same callers, found no path from omarchy-update to the prompt, and raised the point above about the variable undoing #14428's automatic removal, which I checked against the diff and the source. Its independence is not guaranteed, since it can read this session's notes.

What happens next. This waits on the maintainer to close it. #8824, the competing fix, is in the same position and will be looked at on its own.

@AnPod AnPod closed this Oct 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

omarchy-update -y hangs forever at orphan-pkgs: gum confirm ignores OMARCHY_UPDATE_UNATTENDED

4 participants