#4320·herdr

0.9.0: reboot can still clear session when SIGHUP becomes exit code 1

Author: ron23Created Sep 18, 2026Updated Sep 18, 2026
Labelsbugmaintainer-neededp1linuxsessions

Is this a reproducible bug?

  • I confirm this is a reproducible bug, not a feature request, idea, question, contribution proposal, or direction check.
  • I reproduced this bug on the version and environment reported below using the exact steps provided.

Current behavior

Completely Lost all my workspaces/tabs/panes/agents (34 panes across 9 workspaces were terminated).

After a Linux host reboot, Herdr lost the complete saved layout. session.json was explicitly cleared, and the next start created an empty default workspace.

This appears to be an uncovered variant of #3415. Most pane exits were reported without a signal:

pane child exited pane_id=18 status="ExitStatus { code: 1, signal: None }" pane child exited pane_id=30 status="ExitStatus { code: 1, signal: None }" ... session saved event="persist.save" outcome="ok" workspaces=9 server shutdown initiated completing server shutdown session cleared event="persist.clear" outcome="ok" path=/home/user/.config/herdr/session.json

The underlying pane sessions separately reported SIGHUP, suggesting a shell or wrapper translated the signal into exit code 1.

In 0.9.0, classify_child_exit only treats exits with status.signal().is_some() as interrupted. Exit code 1 is therefore treated as a normal pane closure, allowing the session to shrink to zero and be cleared.

The same classification remains in 0.9.1.

Expected behavior

Host shutdown must preserve the last valid session snapshot regardless of whether pane processes report a signal or translate it into a normal nonzero exit code.

session.json should never be cleared merely because pane processes exit immediately before the server receives its shutdown signal

Reproduction

tbh I can't tell for sure, but given the importance of this bug, I think it's worth looking into. Agent:

Use a disposable machine/session because this may delete all Herdr state.

  1. Install Herdr 0.9.0.
  2. Start Herdr and create multiple workspaces, tabs, and panes.
  3. Start agents in some panes.
  4. Confirm ~/.config/herdr/session.json exists.
  5. Run:

herdr update

  1. Wait for the update and server shutdown to complete.
  2. Start Herdr again.

Impact

Completely Lost all my workspaces/tabs/panes/agents (34 panes across 9 workspaces were terminated).

Environment

  • Herdr server at time of failure: 0.9.0
  • Host: Linux
  • Trigger: host reboot
  • Related issue: #3415
  • Related fix: #3418