richardcase / richardcase/clowder

M9c — PTY-host true zero-disruption agent survival

Open
#55 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
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.json registry, 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_RIGHTS fd-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_RIGHTS over 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 — see crates/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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.