* Offer an AI diagnosis when a process crashes systemd-coredump journals every core dump under a known MESSAGE_ID with the crashing program, pid, and signal as structured fields. omarchy-crash-watch follows that stream and raises a "Process crashed: <program>" toast; clicking it opens omarchy-agent-crash, which briefs the default agent on the crash. The toast goes through omarchy-notification-send --exec rather than a libnotify action, because the shell runs clicks from its own omarchy-exec hint and never emits ActionInvoked. It keeps the default "omarchy-action" app name too, the only one shouldBypassDnd() lets through -- a crash being the last notification worth swallowing. It stays quiet until an agent is configured, since a diagnosis is all it offers. The method lives in a diagnose-crash skill rather than the prompt, so it is edited in one place and works with whichever agent is default. It covers investigating the core, and reporting a confirmed Omarchy bug upstream: scoped to bugs Omarchy controls, searched for duplicates first, only with the user's agreement, and signed with the model and harness that produced it. A migration reaches existing installs, whose skill symlinks and unit enablement would otherwise sit behind one-time setup paths. * Let the diagnosis clean up the core it extracted "Do not modify or delete anything" contradicted the symbolization step right above it, which writes a core to a temp file and deletes it on exit. Read literally, the core survives -- and the same section warns it holds passwords and tokens. The prohibition is about the system, not about your own scratch. * Do not spend a crash toast on a dead notification server The shell owns org.freedesktop.Notifications, so its own crash takes the notification server down with it -- and a shell crash is exactly what you want told about. The toast was sent once into that gap and the dedupe window was recorded regardless, so the rest of the crash loop went quiet for a minute and `journalctl -n 0` never replays what was missed. It now waits for the restarted shell to reclaim the bus name, as omarchy-migrate-notify already does, and only a delivered toast starts the dedupe window.
32 lines
1.3 KiB
Bash
32 lines
1.3 KiB
Bash
echo "Announce process crashes and offer an AI diagnosis"
|
|
|
|
# Both halves are set up in paths that only run once -- omarchy-provision-user
|
|
# exits after finalize-user is marked, and install/user/first-run is skipped
|
|
# after the first login -- so existing installs need them done here.
|
|
|
|
skills_source="$OMARCHY_PATH/default/agents/skills"
|
|
|
|
if [[ -d $skills_source/diagnose-crash ]]; then
|
|
for skills_dir in ~/.agents/skills ~/.claude/skills ~/.codex/skills ~/.pi/agent/skills; do
|
|
mkdir -p "$skills_dir"
|
|
ln -sfn "$skills_source/diagnose-crash" "$skills_dir/diagnose-crash"
|
|
done
|
|
fi
|
|
|
|
systemctl --user daemon-reload >/dev/null 2>&1 || true
|
|
|
|
# `systemctl enable` needs a live user manager, which an update from a TTY does
|
|
# not have, so fall back to writing the symlink it would have written.
|
|
if ! systemctl --user enable omarchy-crash-watch.service >/dev/null 2>&1; then
|
|
wants_dir="$HOME/.config/systemd/user/graphical-session.target.wants"
|
|
mkdir -p "$wants_dir"
|
|
ln -sfn /usr/lib/systemd/user/omarchy-crash-watch.service \
|
|
"$wants_dir/omarchy-crash-watch.service"
|
|
fi
|
|
|
|
# Nothing to start into over SSH; the next graphical login handles it. A failed
|
|
# start only delays crash toasts, so it stays quiet.
|
|
if systemctl --user is-active --quiet graphical-session.target; then
|
|
systemctl --user start omarchy-crash-watch.service >/dev/null 2>&1 || true
|
|
fi
|