Skip to content

relay#541: fakerelay serves adoptable rows and the adopt door - #560

Merged
barelyworkingcode merged 4 commits into
epic/525-session-adoptionfrom
feat/541-fakerelay-adopt
Oct 21, 2026
Merged

barelyworkingcode merged 4 commits into
epic/525-session-adoptionfrom
feat/541-fakerelay-adopt

Conversation

@barelyworkingcode

Copy link
Copy Markdown
Owner

Closes #541

fakerelay now serves the adopt fields on outside rows (adoptable, adoptReason, a live row's claudeSessionId). It also answers POST /api/sessions/adopt with relay's success shape and every refusal code and message, word for word. A test chooses the outcome through the world's adopt object, and existing fixtures load unchanged: rows with no keys read adoptable:false, with the reason derived in relay's order.

  • The merged relay code wins over relay#527's contract in five places. The issue's contract lists them.
  • The rule that refused a live row's claude_session_id is lifted, because relay#527 now serves that id on live rows. Two assertions in outside_test.go changed. Bad values stay refused on live and ended rows.
  • No docs/FEATURES.md row moves. fakerelay/** and e2e/contract/** are in the no-test area, and nothing a user reaches changed.
  • Waits: the instance ready line, HTTP answers, until on WebSocket revisions, and a followed log for session.adopt. No sleeps.

Tests: fakerelay/prooftest/adopt_test.go (row fields, fixture rules, success, interrupt and recovery, all refusals, door class) and e2e/contract/s_adopt_test.go (the refusals both targets can stage; their transcripts match).

Runs on dc0aaf8:

  • (cd fakerelay && go test -race -count=1 ./...): ok.
  • TestAdoptContractRefusals: ok on both targets.
  • The full e2e/contract: two older tests are red, and they are red on the epic base too (552a068). The cause is relay#559, filed: the epic's real relay answers providerState on POST /api/sessions. main is green.
  • e2e feature baseline: one load flake, TestRefusedSecondMessageKeepsFirstReply, green three times alone. This PR does not touch relay itself.

Fix attempts: one review fix round (message assertions and the ambiguous staging), then one line for launch_failed. Tokens: about 0.75M across subagents.

Minor, not fixed (theoretical): an adopted fake session records its conversation id just after it joins the list, and launch_failed answers even if a fixture replace already dropped the row.

Review: no blocking findings (round 3, clean)
Journey: n/a: fakerelay is a test tool; no devbox journey reaches it
Break-and-restore: serving adoptable as false turned TestAdoptRowFieldsServed red; a changed launch_failed message turned TestAdoptRefusals red; both restored byte for byte
Weakening reviewed: outside_test.go live-row claude_session_id refusal lifted; relay#527 decision 2 serves the id on live rows; bad-value refusals kept

🤖 Generated with Claude Code

barelyworkingcode and others added 4 commits October 20, 2026 18:49
Outside rows carry adoptable and adoptReason, live rows may carry
claudeSessionId, and the adopt door answers relay's codes from the row's
adopt fixture.

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

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>
@barelyworkingcode
barelyworkingcode merged commit 2faa421 into epic/525-session-adoption Oct 21, 2026
@barelyworkingcode
barelyworkingcode deleted the feat/541-fakerelay-adopt branch October 21, 2026 02:16
@barelyworkingcode

Copy link
Copy Markdown
Owner Author

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

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