Download Latest Version v0.4.0 -- QAT Gemma 4 default models source code.tar.gz (5.4 MB)
Email in envelope

Get an email when there's a new version of AgentHandover

Home / v0.2.10
Name Modified Size InfoDownloads / Week
Parent folder
AgentHandover-0.2.10.pkg 2026-04-18 10.5 MB
README.md 2026-04-16 2.0 kB
v0.2.10 -- detach daemon from launching shell via setsid() source code.tar.gz 2026-04-16 5.3 MB
v0.2.10 -- detach daemon from launching shell via setsid() source code.zip 2026-04-16 5.5 MB
Totals: 4 Items   21.4 MB 0

Fixes the daemon silently disappearing after the launching shell exits. Isolated by hikoae on v0.2.9 with a precise repro: daemon runs stably for 7+ minutes when the launching shell stays alive, but dies within seconds when the shell exits. macOS unified log showed nothing (no SIGKILL, no jetsam, no TCC) — ruling out external kills.

Root cause

Classic Unix process-group/session issue. When you ran agenthandover restart from a terminal, the daemon was spawned as a detached child that reparented to init (PPID=1) correctly — but its process group ID stayed tied to the launching shell's process group. When the shell closed its controlling TTY, SIGHUP was sent to every process in that group, including the daemon. Default SIGHUP action is immediate termination with no signal handler invocation, no stderr output, no unified log entry, no crash report. The daemon just silently disappeared.

The fix

libc::setsid() at the top of daemon's main() creates a new session with the daemon as its leader. Detaches from the launching shell's session and process group. SIGHUP from shell exit no longer reaches the daemon.

Plus a SIGHUP signal handler as defense in depth — if setsid() ever fails for some reason, or if SIGHUP arrives via another path (explicit kill -HUP, logrotate conventions), the daemon shuts down cleanly with full logs instead of dying silently.

Verification

/bin/ps -j before and after the fix:

  • Before: daemon PGID matched launching shell's PGID → SIGHUP propagated
  • After: daemon has PID == PGID, session leader flag s in STAT, TT=?? (no controlling terminal), survives subshell exit

Install

:::bash
brew upgrade --cask agenthandover

curl -LO https://github.com/sandroandric/AgentHandover/releases/download/v0.2.10/AgentHandover-0.2.10.pkg
sudo installer -pkg AgentHandover-0.2.10.pkg -target /

Relates to issue [#1] (NOT closing — waiting for reporter's v0.2.10 retest).

Source: README.md, updated 2026-04-16