richardcase / richardcase/clowder
M9c — PTY-host true zero-disruption agent survival
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 0
- Forks
- 0
- Avg merge
- 1h 14m
- Merged PRs (30d)
- 16
Description
Context
Agent survival shipped in two slices this cycle:
- M9a (#50) — durable
agents.jsonregistry, reconcile-on-startup, adapter session-resume (claude --continue). Agents re-spawn in their worktree after a daemon restart. - M9b (#51) — full split-layout restore (companion shells rebuilt in the same arrangement).
M9c is the deferred capstone: true zero-disruption survival. Today a restart re-spawns each agent (fresh process; the prior conversation is only recovered via the adapter's own resume, and scrollback/companion output is lost). M9c makes agents — and their scrollback and running processes — survive a daemon restart with no re-spawn at all.
Design (already written)
docs/superpowers/specs/2026-08-02-clowder-m9-agent-survival-design.md §M9c (DEFERRED — design only):
A persistent PTY-host process owns the agent PTYs + child processes + recent backlog and outlives the daemon. The daemon becomes a client of it: on restart the daemon re-attaches to the still-running agents (PTY master fds handed over via
SCM_RIGHTSfd-passing over a unix socket), so agents — and their scrollback — survive with zero disruption.
This splits today's daemon into a small, rarely-restarted PTY-server + the churny restartable control-daemon.
Scope (big — its own spec → plan → SDD cycle)
- New PTY-host component + an fd-passing protocol (
SCM_RIGHTSover a unix socket). - Backlog/scrollback ownership moves to the host (the daemon's current in-memory backlog becomes the host's).
- Child reaping in the host (not the daemon).
- Suppress the current triple-kill on the daemon side (SIGHUP-on-master-drop +
Drop for Pane+shutdown()explicit kill — seecrates/clowder-daemon/src/pane.rs), so agents aren't killed when the daemon exits. Screen::snapshot()(from the VT-grid milestone, #52) is a ready substrate for the recent-screen restore.
Acceptance
A running agent survives a daemon kill + relaunch with its process, scrollback, and companion shells intact — no re-spawn, no lost conversation — and the app reconnects to the still-live session.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Read docs/superpowers/specs/2026-08-02-clowder-m9-agent-survival-design.md §M9c first, then inspect crates/clowder-daemon/src/pane.rs and the Screen::snapshot() substrate from #52. Define the PTY-host and fd-passing protocol before implementation. Done means an agent, its process, scrollback, and companion shells survive daemon kill and relaunch without respawn.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cli, operating-systems
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100