The chat reopened on every shell start while a stale "unseen" result was
left over. Now the helper checks the job's unit for a running rebuild
(zcli, nixos-rebuild, nh, home-manager) and only then reopens; other
restarts keep following a running job quietly.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A rebuild restarts the shell mid-job, and the restarted shell asked
systemd whether the job's unit was alive while the user manager was
reloading. The failed query read as "stopped", so the chat showed
"interrupted" and stopped polling, and the real result never appeared.
A job now counts as dead only when systemd says its unit stopped and its
worker process is gone.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Each request runs in its own systemd user unit and survives the shell
restarting; the chat reopens on a running job or an unseen result. Auto
picks the subscription with the most usage left (ai-usagebar). Runs are
snapshotted so Undo can restore files and revert commits.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>