M9c — PTY-host true zero-disruption agent survival

未关闭
#55 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
25/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
冷清
技术栈
rust

调研方向

先阅读 docs/superpowers/specs/2026-08-02-clowder-m9-agent-survival-design.md §M9c,然后检查 crates/clowder-daemon/src/pane.rs 以及 #52 中的 Screen::snapshot() substrate。在实现之前定义 PTY-host 和 fd-passing 协议。当 agent、其进程、scrollback 和 companion shells 能够在 daemon 被 kill 并重新启动后无需 respawn 仍然存活时,即表示完成。

由索引模型根据 Issue 内容生成。

描述

enhancement

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.

主要语言
Rust
星标
0
派生
0
PR 合并指标
30 天内没有已合并 PR

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

richardcase/clowder 的其他 Issue

查看 richardcase/clowder 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。