Skip to content

Stop the crash watcher from reporting its own probe - #10680

Open
llirik0 wants to merge 2 commits into
omacom:quattrofrom
llirik0:fix/issue-10662-crash-watch-self-loop
Open

llirik0 wants to merge 2 commits into
omacom:quattrofrom
llirik0:fix/issue-10662-crash-watch-self-loop

Conversation

@llirik0

@llirik0 llirik0 commented Sep 7, 2026

Copy link
Copy Markdown

Fixes #10662

The watcher excluded its own crashes by executable name. Its notification health probe runs inside omarchy-crash-watch.service but can crash as quickshell, so the event bypassed that guard and re-entered the same notification path.

This reads COREDUMP_USER_UNIT from the existing journal record and drops events attributed to the watcher’s own service before starting notification work. A normal quickshell crash outside that unit is still reported.

Tests:

  • bash test/shell.d/crash-capture-test.sh
  • Bash syntax and git diff --check
  • Regression test fails when the provenance check is removed
  • ./test/all: CLI passed; shell passed 234/235 files. The remaining config-test.sh package-manifest failure also occurs on an unmodified quattro checkout.

#7155 changes the watcher’s transport but retains name-based self-exclusion, so it does not cover this failure mode. If it lands first, this provenance guard will need to be carried into that implementation.

@llirik0
llirik0 force-pushed the fix/issue-10662-crash-watch-self-loop branch from 03dddd2 to 2a3ca6d Compare September 7, 2026 19:11
@llirik0
llirik0 marked this pull request as ready for review September 7, 2026 20:55
@tcballard

Copy link
Copy Markdown
Contributor

FWIW I reviewed this PR. The service-origin check looks correct for #10662: it excludes the watcher’s own crashing helpers while preserving notifications for genuine shell crashes.

The focused suite passed all 34 checks, and the new regression failed against the original watcher as expected. Eight additional journal-replay cases also passed, covering ordinary Quickshell crashes, missing/empty service metadata, other users and mixed event streams.

Two small test improvements would make this stronger:

  1. Add a positive case for a genuine Quickshell crash outside the watcher’s service. Replacing the new guard with a blanket exclusion of /usr/bin/quickshell still passes all 34 checks. A positive case would catch that regression. Ideally, put an excluded probe crash and a genuine shell crash in the same stream to verify processing continues.

  2. Reset the journal fixture before the Hyprland mute assertion. The new test leaves a watcher-owned Quickshell event in JOURNAL_ENTRIES. The following mute hyprland on / run_watch therefore checks a stream containing no Hyprland crash, so that assertion passes without exercising muting. Restore a Hyprland crash entry first.

I found no blocking issue in the production change and would support merging it in future (although I'm not empowered to do so!)

@omarchybot omarchybot added bug Something isn't working verified Omarchy Triage has verified that this issue is ready for final review labels Sep 27, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

Reviewed and verified on a disposable Omarchy worker VM (omarchy 4.0.4). The fix holds, and I pushed one test-only commit on top.

Reproduced. I ran the real omarchy-crash-watch.service with a stand-in omarchy-shell that segfaults on notifications ping, set off one ordinary crash outside the service, and counted core dumps attributed to omarchy-crash-watch.service every 15 seconds:

Pushed 6366e01 to test/shell.d/crash-capture-test.sh, for the two gaps @tcballard pointed out, both confirmed on the worker:

  • The new block reset the journal to the probe's crash alone, so the existing "muting a program stops its crash notifications" assertion after it ran against a stream with no Hyprland crash and passed even with muting deleted from the watcher. It now restores the Hyprland crash first.
  • A quickshell crash outside the watcher's service, in the same stream as the probe's, must still be announced. Without it, excluding /usr/bin/quickshell by name passed every check; now that fails, as does removing the guard or ignoring mutes.

Tests: crash-capture-test.sh 35/35 and ./test/cli green on the worker at 6366e01.

Second opinion: Codex at medium effort reviewed the final head and found no defects. It agreed that COREDUMP_USER_UNIT is the right signal and that the toast's --exec diagnosis runs from the shell rather than inside the watcher's service, so it is not swallowed by the guard. It reviewed after my own conclusions were written, so its agreement is not guaranteed independent.

#7155 changes the watcher's transport and keeps name-based self-exclusion, so whichever lands second needs this guard carried across. #8872 and #8881 bound omarchy-notification-wait by wall-clock time, which would shorten each burst of probe crashes but not stop the loop.

Nothing is needed from you. GitHub has run no CI on this pull request yet, so it waits on that and then on the maintainer.

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

greptile-apps Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[Medium risk] Crash watcher filters out its own internal probe crashes.

The PR appears safe to merge.

Summary

The PR filters coredumps attributed to omarchy-crash-watch.service before notification work begins.

  • Adds coverage for a service-attributed quickshell crash and an ordinary quickshell crash.
  • Keeps the subsequent mute test isolated from the new fixtures.

Reviews (2) · Last reviewed commit: "Keep the mute assertion fed and cover a ..."

llirik0 and others added 2 commits October 3, 2026 01:45
The probe test reset the journal to the probe's crash alone, so the mute assertion after it ran against a stream with no Hyprland crash in it and passed whether muting worked or not. It now restores the Hyprland crash first.

The guard is keyed on the service, so assert a quickshell crash outside it still announces, in the same stream as the probe's: excluding /usr/bin/quickshell by name would otherwise pass every check.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@llirik0
llirik0 force-pushed the fix/issue-10662-crash-watch-self-loop branch from 6366e01 to 5ec56e1 Compare October 3, 2026 08:52
@omarchybot omarchybot added the verified Omarchy Triage has verified that this issue is ready for final review label Oct 3, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

Re-verified after the rebase onto quattro (a85e29a). Both commits carry the same patch as before, and nothing on quattro since the last check touches the watcher, its test or the notification scripts. I re-ran everything at 5ec56e1 on a disposable Omarchy worker VM anyway.

Reproduced again. I ran the real omarchy-crash-watch.service with a stand-in omarchy-shell whose notifications ping segfaults, set off one ordinary crash outside the service, and counted core dumps attributed to the service every 15 seconds:

crash-capture-test.sh passes 35/35 here. With the guard removed, or against quattro's watcher, its new check fails.

The CLI suite is not green, and the cause is on quattro, not here. test/cli:616 expects omarchy-theme-set-vscode to symlink the generated theme, but quattro's script copies it, and the suite stops at that first failure. The same assertion fails on quattro alone. With that assertion and the obsolete-marker check after it taken out, the other 115 checks pass on this branch and on quattro alike. So this pull request can't be marked ready until quattro's suite is fixed.

Second opinion: Codex at medium effort reviewed this head and found no defects. It agreed that the service the crash came from is the right signal, and that a genuine shell crash or the diagnosis started from the toast's --exec is still announced, because the shell (shell/plugins/notifications/Service.qml:403) runs those, not the watcher's service. Its agreement is not guaranteed independent.

#7155 is still open. Whichever of the two lands second needs this guard carried across.

There's nothing for you to do. This waits on the quattro suite fix and then on the maintainer.

KewkLW added a commit to KewkLW/omarchy-fork that referenced this pull request Nov 27, 2026
A crash diagnosis can crash things itself. The agent reproduces the
crash it is looking at (brave --help during a brave diagnosis), or the
agent dies on its own (opencode during a WebKitWebProcess diagnosis).
Each of those was announced like a new crash, offering a fresh agent
per hop. The watcher knew a crash only by its name, and neither name
matches its self-exclusion.

omarchy-agent-crash now launches the agent with
OMARCHY_CRASH_DIAGNOSIS=<pid>:<start epoch>. omarchy-agent carries it
in every terminal command it starts, its install and warm-up relaunches
included, as it does the account pin, because uwsm does not pass our
environment on. Everything run from the agent's terminal inherits
it, nested agent launches included. systemd-coredump journals the crashed
process's environment as COREDUMP_ENVIRON, so the watcher reads that
field (--all, because -o json turns a field over 4 KiB into null, and
decoding the byte array the journal sends for an environment holding
a non-UTF-8 or control byte). A crash carrying a marker younger than
OMARCHY_CRASH_DIAGNOSIS_MAX_SECONDS (3600) is still announced, but
without the diagnose action. Past that, a program the agent left
running is offered like any other. An environment variable rather than
the agent's cgroup, because uwsm names the terminal's unit after the
command plus a random suffix, so there is no scope name to match.

As a second guard, omarchy-agent-crash stamps the program under
~/.local/state/omarchy/crash-diagnosis, the base the crash-ignore flags
use, adding a line with the diagnosis's marker to the stamp. The
program counts as under way while any of those diagnoses is: for
OMARCHY_CRASH_DIAGNOSIS_COOLDOWN_SECONDS (600) after its own start, and
after that, up to the maximum, for as long as a process of ours still
carries its marker. While it is under way the watcher announces that
program's crashes without the action, which catches a reproduction
started through omarchy-launch-browser in a systemd-run unit of its own
that never inherits the marker. A line dated in the future, after a
clock step, holds nothing, and lines past the maximum are dropped when
the stamp is next written.

A click on an older toast for a program under way says so and offers
--again to start another anyway, added beside the first so the first
keeps its guard however the two finish. The check and the stamp are taken
under a lock, released before the agent starts, so two clicks cannot
both dispatch. A click with no default agent goes to the agents panel
and stamps nothing, rather than refusing every later click.

This differs from omacom#13835, which mutes the diagnosed program's name
while a lock is held for the agent's lifetime. It does not cover the
agent itself crashing, and it silences a genuine crash of that program
from ordinary use. Here the agent's own crash is caught by the marker,
and no crash is ever silenced: a held crash still gets its toast, only
without a second agent. The omacom#10662 self-exclusion is left to omacom#10680.

Refs omacom#11992

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@omarchybot omarchybot removed the verified Omarchy Triage has verified that this issue is ready for final review label Nov 27, 2026
KewkLW added a commit to KewkLW/omarchy-fork that referenced this pull request Nov 29, 2026
A crash diagnosis can crash things itself. The agent reproduces the
crash it is looking at (brave --help during a brave diagnosis), or the
agent dies on its own (opencode during a WebKitWebProcess diagnosis).
Each of those was announced like a new crash, offering a fresh agent
per hop. The watcher knew a crash only by its name, and neither name
matches its self-exclusion.

omarchy-agent-crash now launches the agent with
OMARCHY_CRASH_DIAGNOSIS=<pid>:<start epoch>. omarchy-agent carries it
in every terminal command it starts, its install and warm-up relaunches
included, as it does the account pin, because uwsm does not pass our
environment on. Everything run from the agent's terminal inherits
it, nested agent launches included. systemd-coredump journals the crashed
process's environment as COREDUMP_ENVIRON, so the watcher reads that
field (--all, because -o json turns a field over 4 KiB into null, and
decoding the byte array the journal sends for an environment holding
a non-UTF-8 or control byte). A crash carrying a marker younger than
OMARCHY_CRASH_DIAGNOSIS_MAX_SECONDS (3600) is still announced, but
without the diagnose action. Past that, a program the agent left
running is offered like any other. An environment variable rather than
the agent's cgroup, because uwsm names the terminal's unit after the
command plus a random suffix, so there is no scope name to match.

As a second guard, omarchy-agent-crash stamps the program under
~/.local/state/omarchy/crash-diagnosis, the base the crash-ignore flags
use, adding a line with the diagnosis's marker to the stamp. The
program counts as under way while any of those diagnoses is: for
OMARCHY_CRASH_DIAGNOSIS_COOLDOWN_SECONDS (600) after its own start, and
after that, up to the maximum, for as long as a process of ours still
carries its marker. While it is under way the watcher announces that
program's crashes without the action, which catches a reproduction
started through omarchy-launch-browser in a systemd-run unit of its own
that never inherits the marker. A line dated in the future, after a
clock step, holds nothing, and lines past the maximum are dropped when
the stamp is next written.

A click on an older toast for a program under way says so and offers
--again to start another anyway, added beside the first so the first
keeps its guard however the two finish. The check and the stamp are taken
under a lock, released before the agent starts, so two clicks cannot
both dispatch. A click with no default agent goes to the agents panel
and stamps nothing, rather than refusing every later click.

This differs from omacom#13835, which mutes the diagnosed program's name
while a lock is held for the agent's lifetime. It does not cover the
agent itself crashing, and it silences a genuine crash of that program
from ordinary use. Here the agent's own crash is caught by the marker,
and no crash is ever silenced: a held crash still gets its toast, only
without a second agent. The omacom#10662 self-exclusion is left to omacom#10680.

Refs omacom#11992

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
KewkLW added a commit to KewkLW/omarchy-fork that referenced this pull request Dec 2, 2026
A crash diagnosis can crash things itself. The agent reproduces the
crash it is looking at (brave --help during a brave diagnosis), or the
agent dies on its own (opencode during a WebKitWebProcess diagnosis).
Each of those was announced like a new crash, offering a fresh agent
per hop. The watcher knew a crash only by its name, and neither name
matches its self-exclusion.

omarchy-agent-crash now launches the agent with
OMARCHY_CRASH_DIAGNOSIS=<pid>:<start epoch>. omarchy-agent carries it
in every terminal command it starts, its install and warm-up relaunches
included, as it does the account pin, because uwsm does not pass our
environment on. Everything run from the agent's terminal inherits
it, nested agent launches included. systemd-coredump journals the crashed
process's environment as COREDUMP_ENVIRON, so the watcher reads that
field (--all, because -o json turns a field over 4 KiB into null, and
decoding the byte array the journal sends for an environment holding
a non-UTF-8 or control byte). A crash carrying a marker younger than
OMARCHY_CRASH_DIAGNOSIS_MAX_SECONDS (3600) is still announced, but
without the diagnose action. Past that, a program the agent left
running is offered like any other. An environment variable rather than
the agent's cgroup, because uwsm names the terminal's unit after the
command plus a random suffix, so there is no scope name to match.

As a second guard, omarchy-agent-crash stamps the program under
~/.local/state/omarchy/crash-diagnosis, the base the crash-ignore flags
use, adding a line with the diagnosis's marker to the stamp. The
program counts as under way while any of those diagnoses is: for
OMARCHY_CRASH_DIAGNOSIS_COOLDOWN_SECONDS (600) after its own start, and
after that, up to the maximum, for as long as a process of ours still
carries its marker. While it is under way the watcher announces that
program's crashes without the action, which catches a reproduction
started through omarchy-launch-browser in a systemd-run unit of its own
that never inherits the marker. A line dated in the future, after a
clock step, holds nothing, and lines past the maximum are dropped when
the stamp is next written.

A click on an older toast for a program under way says so and offers
--again to start another anyway, added beside the first so the first
keeps its guard however the two finish. The check and the stamp are taken
under a lock, released before the agent starts, so two clicks cannot
both dispatch. A click with no default agent goes to the agents panel
and stamps nothing, rather than refusing every later click.

This differs from omacom#13835, which mutes the diagnosed program's name
while a lock is held for the agent's lifetime. It does not cover the
agent itself crashing, and it silences a genuine crash of that program
from ordinary use. Here the agent's own crash is caught by the marker,
and no crash is ever silenced: a held crash still gets its toast, only
without a second agent. The omacom#10662 self-exclusion is left to omacom#10680.

Refs omacom#11992

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
KewkLW added a commit to KewkLW/omarchy-fork that referenced this pull request Dec 2, 2026
A crash diagnosis can crash things itself. The agent reproduces the
crash it is looking at (brave --help during a brave diagnosis), or the
agent dies on its own (opencode during a WebKitWebProcess diagnosis).
Each of those was announced like a new crash, offering a fresh agent
per hop. The watcher knew a crash only by its name, and neither name
matches its self-exclusion.

omarchy-agent-crash now launches the agent with
OMARCHY_CRASH_DIAGNOSIS=<pid>:<start epoch>. omarchy-agent carries it
in every terminal command it starts, its install and warm-up relaunches
included, as it does the account pin, because uwsm does not pass our
environment on. Everything run from the agent's terminal inherits
it, nested agent launches included. systemd-coredump journals the crashed
process's environment as COREDUMP_ENVIRON, so the watcher reads that
field (--all, because -o json turns a field over 4 KiB into null, and
decoding the byte array the journal sends for an environment holding
a non-UTF-8 or control byte). A crash carrying a marker younger than
OMARCHY_CRASH_DIAGNOSIS_MAX_SECONDS (3600) is still announced, but
without the diagnose action. Past that, a program the agent left
running is offered like any other. An environment variable rather than
the agent's cgroup, because uwsm names the terminal's unit after the
command plus a random suffix, so there is no scope name to match.

As a second guard, omarchy-agent-crash stamps the program under
~/.local/state/omarchy/crash-diagnosis, the base the crash-ignore flags
use, adding a line with the diagnosis's marker to the stamp. The
program counts as under way while any of those diagnoses is: for
OMARCHY_CRASH_DIAGNOSIS_COOLDOWN_SECONDS (600) after its own start, and
after that, up to the maximum, for as long as a process of ours still
carries its marker. While it is under way the watcher announces that
program's crashes without the action, which catches a reproduction
started through omarchy-launch-browser in a systemd-run unit of its own
that never inherits the marker. A line dated in the future, after a
clock step, holds nothing, and lines past the maximum are dropped when
the stamp is next written.

A click on an older toast for a program under way says so and offers
--again to start another anyway, added beside the first so the first
keeps its guard however the two finish. The check and the stamp are taken
under a lock, released before the agent starts, so two clicks cannot
both dispatch. A click with no default agent goes to the agents panel
and stamps nothing, rather than refusing every later click.

This differs from omacom#13835, which mutes the diagnosed program's name
while a lock is held for the agent's lifetime. It does not cover the
agent itself crashing, and it silences a genuine crash of that program
from ordinary use. Here the agent's own crash is caught by the marker,
and no crash is ever silenced: a held crash still gets its toast, only
without a second agent. The omacom#10662 self-exclusion is left to omacom#10680.

Refs omacom#11992

Co-Authored-By: Claude Fable 5.1 <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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

omarchy-crash-watch self-sustains a coredump loop: its self-exclusion guard matches process names, but its own health check crashes as quickshell

3 participants