Skip to content

Report failed theme removal before announcing success - #12385

Open
yashranaway wants to merge 9 commits into
omacom:quattrofrom
yashranaway:fix/report-theme-removal-failure
Open

yashranaway wants to merge 9 commits into
omacom:quattrofrom
yashranaway:fix/report-theme-removal-failure

Conversation

@yashranaway

@yashranaway yashranaway commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

Stops theme removal from announcing success when it could not delete the theme directory.

<<<< AI wording below >>>>

Problem

omarchy-theme-remove ignores a failed rm -rf, sends a "Theme removed" notification, prints "Removed", and exits successfully. A permissions or filesystem error therefore looks like a completed removal even when the theme remains installed.

Fix

Preserve the deletion diagnostic, identify the theme, and send a failure notification instead of announcing success.

Verification

bash test/shell.d/theme-remove-failure-test.sh passes. Changed Bash files pass syntax checks and git diff --check passes.

@llstrk

llstrk commented Sep 25, 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.

Verified: the fix does what the description says. With a real permission failure, the patched omarchy-theme-remove exits 1, keeps the rm diagnostic, names the theme, and sends no "Theme removed" notification. The success path is unchanged. The new test fails on the base commit and passes on this head. One suggestion follows for the menu path.

Same synthetic theme with a read-only subdirectory, real rm (no stub):

Base 28ceaae Head ab466fb
Exit status 0 1
stdout Removed locked (none)
stderr rm: cannot remove '.../locked/sub/a.txt': Permission denied same line, then Error: Could not remove theme 'locked'.
Notification Theme removed locked none

Verified: by GNU coreutils source, rm -f ignores only "does not exist" errors (ENOENT, ENOTDIR, EINVAL, EILSEQ). Permission, read-only filesystem and busy errors make rm -rf exit nonzero, so the new if ! rm -rf check catches the failures the description names. Running omarchy theme remove NAME from a terminal now shows the error and a failing exit status.

Menu removals now fail with no feedback

Remove > Theme runs omarchy-theme-remove through Util.execDetached and Quickshell's execDetached. At Quickshell 0.3.1 (the Arch package), a detached process's stdout and stderr go to the null device, and the menu does not check the exit status:

Remove > Theme -> omarchy-theme-remove (detached)
  rm -rf fails -> stderr: rm error + "Could not remove theme"  -> /dev/null
               -> exit 1                                        -> not inspected
               -> no notification

This was traced in source and not run from a live menu.

Impact: from the menu, a failed removal used to show a false "Theme removed" notification. It now shows nothing at all, so the user cannot tell whether the removal failed. rm -rf also carries on past a failed entry. In the run above, colors.toml was deleted and only sub/a.txt remained, so the theme directory can be left partly deleted.

Suggested change: send a failure notification in the error branch, following existing uses such as bin/omarchy-menu-share:

if ! rm -rf "$THEME_PATH"; then
  echo "Error: Could not remove theme '$THEME_NAME'." >&2
  omarchy-notification-send -u critical "Could not remove theme" "$THEME_NAME" || true
  exit 1
fi

The test's [[ ! -s $NOTIFICATION_LOG ]] check would then need to assert only that no "Theme removed" text was logged. Optionally, the message could say that some theme files may remain.


Review information

Test scope: Source review of bin/omarchy-theme-remove, its callers (menu entry and omarchy CLI dispatch), the test/shell.d harness, GNU coreutils rm source (9.11 and 9.12), and Quickshell 0.3.1 detached-process handling. Isolated command-line runs with a synthetic HOME and theme directories: the PR test on head and base, real rm permission failures (read-only theme subdirectory and read-only themes directory), and a real successful removal. The menu behavior comes from source only. No live desktop session was used.

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.

@omarchybot omarchybot added the bug Something isn't working label Sep 27, 2026
omarchybot and others added 2 commits October 1, 2026 09:32
The menu runs omarchy-theme-remove detached, so the error on stderr reaches nobody and a failed removal from Remove > Theme was silent. Send a critical notification on failure, and write the two outcomes as an if/else per the style guide.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@omarchybot omarchybot added the verified Omarchy Triage has verified that this issue is ready for final review label Oct 1, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

Reviewed and verified on a disposable Omarchy worker VM. The bug is real and this fixes it.

Reproduction. I gave a theme a read-only subdirectory so a real rm -rf fails, with no stubbed rm. On the base, omarchy-theme-remove exits 0, prints Removed locked and sends "Theme removed", even though the theme is still partly on disk. On this branch it exits 1, keeps the rm error, and announces no success. With the change reverted, the new test fails again.

Pushed to your branch. I added two small commits:

  • 8d6f423e1 sends a critical "Could not remove theme" notification when removal fails. Remove > Theme in the menu runs this command detached (default/omarchy/omarchy-menu.jsonc:291), so stderr reaches nobody. Without the notification, a failed removal from the menu would have shown nothing at all. The commit also writes the success and failure paths as an if/else, which is what AGENTS.md prefers. The test now checks that the failure notification is sent, and it clears the log before the success case.
  • ecf664367 gives the test's rm stub the same if/else shape.

Tests. theme-remove-failure-test.sh, theme-install-guards-test.sh and bin-style-test.sh pass on the worker. In ./test/cli, everything passes except vscode generated theme references current theme file. That test fails the same way on this branch's merge base and on current quattro (8b4eae66d), so it does not come from this change. The PR has no CI checks.

Second opinion. Codex at medium effort reviewed the diff in two rounds. It agreed the bug is real and the fix proportionate, and found no defects. Its one note, the stub's shape, is the second commit above. Its agreement is not guaranteed to be independent of my review.

What happens next. The fix is verified at ecf664367. It is waiting on the maintainer, and on the unrelated ./test/cli failure on quattro being fixed. Nothing is needed from you.

@greptile-apps

greptile-apps Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no outstanding finding or new actionable issue remains.

Summary

The PR reports a failed theme deletion instead of announcing success.

  • Adds a localized failure-notification title.
  • Adds a regression test for failed and successful removal.

Reviews (5) · Last reviewed commit: "Translate theme removal failure notifica..." · Reviewed by Greptile

@omarchybot omarchybot removed the verified Omarchy Triage has verified that this issue is ready for final review label Oct 1, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

The head moved to 5a1843e66 since this was verified at ecf664367, so the verified label came off and this needs to be checked again before it can go back on.

What changed. I read the new commits. b57ab75d5 adds two assertions to test/shell.d/theme-remove-failure-test.sh: the rm error and the theme name both reach stderr when removal fails. The other two are merges from quattro. bin/omarchy-theme-remove is the same as the version that was reproduced and verified on a worker last time.

Why it stops here. Every item is classified by two models working separately, and a push means asking both again. The second model (Codex Medium) could not answer this time because today's review budget is used up. Without that second answer the classification is unsettled, so I did not run the worker again and added no labels. Nothing was found wrong with the new commits. Claude Opus 5.5 read them; no second model reviewed them.

What happens next. This is waiting on the maintainer to send it back for review once a second model can answer. Nothing is needed from you.

@omarchybot omarchybot removed the bug Something isn't working label Oct 2, 2026
@omarchybot omarchybot added bug Something isn't working verified Omarchy Triage has verified that this issue is ready for final review ready Good to merge labels Oct 15, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

Verified again at d46e3a4e4 on a disposable Omarchy worker VM. The bug is real and this fixes it.

What changed. The new commits merge quattro and send both notification titles through omarchy-i18n, with theme.removeFailed added to the English catalog. Other languages fall back to English until the translation sync fills them in, which is how the i18n check expects a pull request to add a string. The removal logic is the same as the version verified on 1 October.

Reproduction. A theme with a read-only subdirectory makes a real rm -rf fail, with no stub. With the fix reverted, omarchy-theme-remove exits 0, prints Removed locked and sends "Theme removed" while the theme is still on disk. At this head it exits 1, keeps the rm error, names the theme, and sends a critical "Could not remove theme" notification. theme-remove-failure-test.sh passes at this head and fails with the fix reverted.

Tests. ./test/cli passes on the worker, and so do all the theme-* tests in test/shell.d and bin-style-test.sh. i18n-test.sh has one failure, da/menu.json mirrors the English catalog. It fails the same way with this fix reverted, and this pull request does not touch that file. The i18n-check CI check passes.

Second opinion. Codex at medium effort reviewed the diff at this head and found no defects. It agreed the problem is real and the fix proportionate, and checked that the CLI dispatch and the menu entry both keep the new exit status. Its agreement is not guaranteed to be independent of my review.

What happens next. This is waiting on the maintainer. Nothing is needed from you.

@omarchybot omarchybot removed the ready Good to merge label Nov 18, 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 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.

3 participants