Skip to content

Node-based terminal manager for AI coding agents — tmux-backed terminals and parallel agent sessions as draggable nodes on an infinite pan/zoom canvas. macOS, Linux, and a browser Server Edition.

docs: headless start fence covers SSH projects; the request strips viewerId/clearEnv (#925)

review15d651129c48
diff --git a/CLAUDE.md b/CLAUDE.md
index a5d90c3ec..b976e5865 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -3226,11 +3226,16 @@ command-bearing opens; this does not add a human-confirm dialog or change mobile
`unsupported`), and `IPC.ptyLaunchHeadless` is in `HOST_ONLY_CHANNELS`, so a relay peer that
sends the raw request is refused host-side.
- **Remote nodes are fenced twice.** The primary fence is the renderer's: `startHeadless`
- answers `remote-unsupported` for a node carrying `ssh` / `sshRemoteTmux` before any claim, and
- leaves its launch exactly as it was. Behind it is core's belt: `headlessPtyOptions` sets
- `requireRemote` for an SSH-project (`sshRemoteTmux`) node, and `desktopHeadlessRequest` keeps
- it while stripping `sshRemote`. So if such a node ever got past the fence, core's `spawnNew`
- would refuse it (`spawn-failed`) instead of starting a LOCAL `nt-<id>` wearing its identity.
+ answers `remote-unsupported` before any claim for every node of an SSH project (`project.ssh`)
+ and for a node carrying `ssh` / `sshRemoteTmux`, and leaves its launch exactly as it was. The
+ project is asked, not only the node's flags: a node of an SSH project may carry neither.
+ Behind it is core's belt: `headlessPtyOptions` sets `requireRemote` for an SSH-project
+ (`sshRemoteTmux`) node, and `desktopHeadlessRequest` keeps it while stripping `sshRemote`.
+ So if such a node ever got past the fence, core's `spawnNew` would refuse it (`spawn-failed`)
+ instead of starting a LOCAL `nt-<id>` wearing its identity. `desktopHeadlessRequest` also
+ strips `viewerId` (a create under a viewer id subscribes `(0, viewer)`, while
+ `releaseHeadless` detaches `(0, PRIMARY)`, so client 0 would stay attached forever) and
+ `clearEnv` (a one-shot recycle flag, never a launch option).
- **Why release the client.** An invisible client would fight the viewer's window size and
keep the session "attached" for the reaper forever.
- **No persistent backend** (tmux or session-host): releasing a plain shell would kill it, so the
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 7a4211dc8..4c190ec3d 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -802,8 +802,9 @@ healthy). The desktop releases its headless client, so there a start without a p
backend fails `not-persistent` and hands the node back unchanged (a cold open stays an ordinary
queued node) rather than leaving a shell that the next mount would orphan. Normally that refusal
comes before any spawn; if the backend vanishes between the probe and the spawn, the plain shell it
-got is refused before anything is typed, and releasing it kills it. A remote (SSH) node is refused
-in the renderer before the claim (`remote-unsupported`), which is the primary fence. As a belt
+got is refused before anything is typed, and releasing it kills it. A remote (SSH) node, and any
+node of an SSH project, is refused in the renderer before the claim (`remote-unsupported`), which is
+the primary fence. As a belt
behind it, an SSH-project node's request carries `requireRemote`, which `desktopHeadlessRequest`
keeps, so core's `spawnNew` refuses rather than spawning it locally. Keep both fences.