Skip to content

relay#588: adopt an outside Claude session on an SSH host - #604

Merged
barelyworkingcode merged 16 commits into
mainfrom
epic/588-host-adopt
Oct 23, 2026
Merged

barelyworkingcode merged 16 commits into
mainfrom
epic/588-host-adopt

Conversation

@barelyworkingcode

Copy link
Copy Markdown
Owner

Closes #590

Epic #588. Children: #589 (#597). Eve's half: barelyworkingcode/eve#626. Stays a draft until the joint close task (relay#588, step c).

🤖 Generated with Claude Code

barelyworkingcode and others added 16 commits October 22, 2026 15:51
The host adopt runs as one detached script on the host (check, ladder,
start); relay writes the audit intents and a dormant record before the
SSH command and reads only its result. A dropped link answers
host_link_lost and keeps the record; Resume attaches the started agent or
re-runs the script with no_signal. fakerelay serves an adoptable host row
and the host_link_lost refusal.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
TestAdoptHostSuccess, Busy, Changed and LinkDrop; the host_unsupported case
moves to detach_sessions: false (approved behaviour change); SSHLieStart.
TestAdoptHostLinkDrop is red: the dormant record is not listed.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
A host adopt that ends in adopt_link_lost or adopt_launch_failed saves its
session so it lists as dormant; the resume no longer takes that session's
own hold on the conversation for another's.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…part

A per-session adopt.lock keeps two scripts from running at once. A setup
failure of the SSH command is its own outcome (nothing touched). A resume
answered changed also deletes relay-sessions' saved copy.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
… host

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…oves the record

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…atches the helper by its executable

A real Claude writes request blobs and attachments of hundreds of KiB into
a turn, so the first turn's prompt lies before the 256 KiB tail. The door
then sent child_test "all", and the script read every MCP server, zombie
and turn helper as busy. The door now reads the transcript backwards below
the tail, 1 MiB per read and 8 MiB at most, until it holds the prompt.

ps comm reads "caffeinate" for the turn helper Claude starts by name, so
the script now matches the executable path (/proc/<pid>/exe, else lsof's
first txt entry), as the local adopt does.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
TestAdoptHostNoClaude; SSHNoClaude drops this machine's claude from the stub
host's PATH so the probe finds none.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The seeded claude-code template stays; only the probe result makes the row
host_unsupported.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
relay#589: adopt a terminal Claude on an SSH host
@barelyworkingcode
barelyworkingcode marked this pull request as ready for review October 23, 2026 02:11
@barelyworkingcode

Copy link
Copy Markdown
Owner Author

Evidence, restated from the one child PR #597 (relay#589) and the frozen-head verification on #590.

Review: no blocking findings (#597: three rounds plus a confirm; default model for rounds 1–3)
Journey: session-adopt-host PASS, session-adopt-host-drop PASS (frozen head 1e96e38, stack r590: SUMMARY pass=12 fail=0 blocked=0 notrun=2)
Main harness vs head: main 6954403 harness on a stack from the child head: SUMMARY pass=10 fail=0 blocked=0 notrun=2 (#597)
Break-and-restore: script lifetime checks forced to match: TestAdoptHostChanged red, restored; hostAdopts probe condition removed: TestAdoptHostNoClaude red, restored (#597)
Harness weakening: none (two journeys added; nothing removed, skipped or loosened)
Weakening reviewed: stateNotRun in journey_adopt_host.go is the new journeys' NOTRUN off a stack, which the contract requires

@barelyworkingcode
barelyworkingcode merged commit c8e0fe2 into main Oct 23, 2026
@barelyworkingcode
barelyworkingcode deleted the epic/588-host-adopt branch October 23, 2026 02:12
@barelyworkingcode

Copy link
Copy Markdown
Owner Author

merge-check: merged. approved, target, verified, contract, evidence, owner
Report: 2. The gates themselves: criterion removed The repo suite and the --stack run pass on the epic head, on a stack built with eve's epic head. (issue #590); 2. The gates themselves: criterion removed The script checks the pid's start time before each signal, and on a mismatch it sends nothing and answers 409 changed. (issue #588); 2. The gates themselves: criterion removed When the SSH connection drops at any point of an adopt, the next host probe after the host answers ends it in one of three states: a managed session that runs, a dormant session with Resume and its transcript intact, or the outside session untouched and adoptable again. (issue #588); 2. The gates themselves: criterion removed A resume of a dormant adopted host session continues the same conversation on the host. (issue #588); 2. The gates themselves: criterion removed A row on a host with detach_sessions: false, on a host with no claude-code template, and a Pi or Codex row on a host keep adoptable: false with adoptReason: "host_unsupported". A Windows host still lists no rows. (issue #588)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Verify and close the host-adopt epic (relay)

1 participant