Skip to content

Adopt an idle outside session from the agents board (#597) - #606

Merged
barelyworkingcode merged 5 commits into
epic/596-session-adoptionfrom
feat/597-adopt
Oct 21, 2026
Merged

barelyworkingcode merged 5 commits into
epic/596-session-adoptionfrom
feat/597-adopt

Conversation

@barelyworkingcode

Copy link
Copy Markdown
Owner

Closes #597

PR 2 of 2 for #597 (epic #596). The agents board gets Adopt on an idle, adoptable live outside row and Interrupt and adopt on a working one. Both share one row-action builder with Drop in, Resume and View read-only.

  • Route. POST /api/outside-sessions/:id/adopt with body {interrupt}. Eve checks the id shape and the boolean, then makes one relayTransport.fetch('POST', '/api/sessions/adopt', {outsideId, interrupt}) with no scope. That is the owner-class path Drop in uses, never the chief-of-staff scope. claudeSessionId is dropped from the answer.
  • Fail closed. The button shows only when relay says adoptable === true. A row that is not adoptable shows relay's reason in one line from a fixed text table. A door refusal shows a one-line toast and the button comes back.
  • After adopt. The outside row leaves, and the managed idle session shows Drop in to <name>. After Interrupt and adopt, relay's recovery message carries the chip "Sent by relay after it took over".
  • Feature map. New rows G6.107 and G6.108 (power door none) and a clause on G6.93. docs/api.md documents the route and the row fields.
  • Journey. New journey outside-adopt covers the simple path. It launches the outside Claude as a person's terminal would: no agent entrypoint variables, and the prompt typed into the ready input box. It waits for the reply in the transcript.

Contract amendment 1 (in the issue): the route selftest is dropped, and its checks live in the Playwright spec through fakerelay.

Known, outside this PR

Minor review notes (not fixed)

  1. g6-outside-adopt.spec.js:337: the ended-row test's line check matches /can't be adopted/ only. The button check is sound, and the code keeps ended rows out twice.
  2. g6-outside-adopt.spec.js:419: the busy-refusal toast check matches only the Can't adopt: prefix. The {"interrupt":false} body check holds.
  3. docs/api.md:402: it says cos_list_sessions outside rows carry adoptable/adoptReason. Only cos_session_status does.
  4. journeys-cos-outside.js:178: a missing input box ends as "did not reply", not as its own BLOCKED.
  5. Theoretical: the journey's cleanup order could let relay's managed session rewrite the transcript after it is removed.

Fix attempts: T1 product 0. The outside-adopt journey took 3: launch env, a typed prompt, and the transcript reply wait. The third ran on the default model. Spec 1: the world shape. Tokens: about 1.2M across subagents.

Review: no blocking (round 1, default model; 5 minor in the notes above)
Journey: outside-adopt PASS on a stack at 5e0a04c with real Claude logged in (relay epic 2faa421); FAIL on the default broker stack with relay#562's model_unknown
Real-app check: outside-adopt on a real stack: one tap answered 201 with no claudeSessionId, the outside row left, Drop in showed under Idle, the pane's claude exited, relay audit holds session_adopt ok
Harness weakening: none (adds the outside-adopt journey and one frozen.json entry; other launches unchanged)
Main harness vs head: base harness (epic/596 at d2e6c64) against head 5e0a04c on a stack: outside-thread PASS; head harness: outside-thread PASS
Break-and-restore: removed r.item.adoptable === true from showsAdopt; 3 criterion-5 tests went red; restored, cmp identical

Suite: 865 passed, 0 failed (baseline 841); check:static and check:coverage ok.

🤖 Generated with Claude Code

barelyworkingcode and others added 5 commits October 20, 2026 19:30
Adds the adopt route, the Adopt and Interrupt and adopt row actions on one shared action builder, the relay-recovery chip, and the outside-adopt journey.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…ws G6.107, G6.108 (#597)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Unset CLAUDE_CODE_ENTRYPOINT and CLAUDECODE for this journey only, so relay sees an interactive command-line session.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
For this journey only, start claude with no prompt argument and send the prompt once the input box shows, so relay's child-process veto sees the MCP servers start before the first reply.

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

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@barelyworkingcode
barelyworkingcode merged commit 1399a79 into epic/596-session-adoption Oct 21, 2026
@barelyworkingcode
barelyworkingcode deleted the feat/597-adopt branch October 21, 2026 03:03
@barelyworkingcode

Copy link
Copy Markdown
Owner Author

merge-check: merged. approved, target, contract, evidence, owner, weakening

@barelyworkingcode

Copy link
Copy Markdown
Owner Author

Merged: approved, target, contract, evidence, owner, weakening PASS; ci, verified NA.

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.

1 participant