Skip to content

test(j5): a peer live test can start two servers the peering check finds a route between - #1124

Merged
Jacksondr5 merged 2 commits into
j5/mainfrom
j5code/live-test-peer-reachable
Nov 21, 2026
Merged

Jacksondr5 merged 2 commits into
j5/mainfrom
j5code/live-test-peer-reachable

Conversation

@Jacksondr5

@Jacksondr5 Jacksondr5 commented Nov 21, 2026 •

Copy link
Copy Markdown
Owner

Problem

In a --peer live test, both servers listen on loopback, and a server on loopback offers the peering check no address. Every peering and linking dialog on the rig therefore says it found no route and asks for an address. The state a person usually meets, where the check succeeds and nothing is asked, could not be tested or captured. It came up in the review of #1119, whose captures all show the "no route" state.

What changed

--peer --reachable is a third peer mode. It starts both test servers on every interface, IPv4 and IPv6 (--host ::), much as --mobile phone already does for its one server. Each server then offers this machine's network addresses, and the check finds a route.

  • IPv6 is included because a link's tools take plain http only at a Tailscale name or IPv6 address (upstream's rule in PeerLinks.ts). A first tester pass on 0.0.0.0 found a LAN route that messages used and tools were refused on. Tools between the two servers therefore work only when the machine is on a tailnet; the script's output and the skill say so.

  • It is a mode, not a setting, so restart keeps it and a plain --peer start on that home is refused, like every other mode.

  • The dev runner binds a server with a web client to loopback or to every interface, never to one address, so the mode needs no address from a personal config file.

  • The two servers are still peered through 127.0.0.1, as in --peer.

  • --peer itself is unchanged, so the "no route" state stays reachable. The skill now says why its dialogs ask for an address, and what to type.

The servers are reachable from this machine's LAN and Docker networks while they run. They are isolated test homes and admit only a device with a pairing link. The script's output says so, as it does for the phone mode.

Live testing

Run by hand on this branch, not by a tester:

  • At adc201fce7: --peer --reachable built and started both servers. ss showed both server ports on * (every interface, both families) and the web port on 127.0.0.1. Each server answered /.well-known/t3/environment at this machine's Tailscale IPv6 address and at 127.0.0.1. remove stopped both and deleted the home.
  • At 192739e6ab, when the mode bound 0.0.0.0: restart brought both back in the same mode, and --peer on that home was refused with the mode message. Not repeated at the head: the bind address is the only thing that changed.

A Peer Agent tester (GPT 6.1 Sol) ran the #1004 stack on this script twice:

  • At 192739e6ab: the check found a route with no address typed, and the Link dialog showed its ordinary state. One direction's tools were then refused, which is the IPv4-only problem above.
  • At adc201fce7: pass. Both server ports listened on every interface, the check chose the Tailscale IPv6 address, and Link reported messages and tools both ways with no address typed. The captures are on feat(web): one dialog links servers, after adding one and from an agent's request #1119.

Not exercised: the mode on a machine with no tailnet, where the check still finds a route for messages and tools are refused.

Checklist

  • One concern: the description has no "also"
  • Tests cover the changed behavior (backend changes ship with focused tests): the command parser's table has the new mode and its refused combinations. The start itself is covered by the run above.
  • UI changes: before/after screenshots above, and a video for motion or interaction: no UI change
  • Live testing: the section above says what ran live and what did not
  • Upstream-owned files: each one is recorded in FORK.md (case text and file-table row) in this PR: none edited
  • Upstream product: any change to what upstream's product does has a human decision linked above and a register entry in docs/j5/product/upstream.md: none
  • Surfaces: entry points, clients, providers, contracts, reverse states, connection modes (see AGENTS.md): the rig's usage text, its rebuild help and the j5-live-test skill name the mode
  • Docs: definitions under docs/j5/product/ and user docs rewritten where this changes them: none apply; the skill is updated

Claude Fable 5.2, in Claude Code through J5 Code.

🤖 Generated with Claude Code

…nds a route between

In --peer, both test servers listen on loopback, where a server offers the
peering check no address. Every dialog then says it found no route and asks
for one, so the state a person usually meets could not be tested or captured.

--peer --reachable starts both servers on every interface, as the phone mode
does for its one server. Each then offers this machine's network addresses
and the check finds a route.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@vercel

vercel Bot commented Nov 21, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
j5-code Ready Ready Preview Nov 21, 2026 4:35am UTC

Request Review

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:M 30-99 effective changed lines (test files excluded in mixed PRs). labels Nov 21, 2026
@coderabbitai

coderabbitai Bot commented Nov 21, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The live-test harness adds a --peer --reachable mode. It starts both peer servers with --host :: and updates the setup instructions, usage text, rebuild guidance, and argument tests.

Changes: Reachable peer mode

Layer / File(s) Summary
Mode selection and server launch
scripts/j5/setup-agent-live-test.ts
The harness adds peer-reachable to its peer modes and CLI options. In this mode, both servers receive --host ::. Rebuild guidance includes the new mode.
Mode instructions and validation
scripts/j5/setup-agent-live-test.ts, .agents/skills/j5-live-test/SKILL.md, scripts/j5/setup-agent-live-test.test.ts
Instructions distinguish the reachable setup from loopback peer mode. Tests check that --peer --reachable selects the new mode and that --reachable alone or with --peer --poll is rejected.

Estimated code review effort: 2 (Simple) | ~10 minutes

Sequence Diagram(s)

sequenceDiagram
  participant CLI
  participant LiveTestHarness
  participant LocalServer
  participant RemoteServer
  CLI->>LiveTestHarness: --peer --reachable
  LiveTestHarness->>LocalServer: startServer with --host ::
  LiveTestHarness->>RemoteServer: startServer with --host ::
Loading

Possibly related issues

Suggested reviewers: bastihu

Merge Risk: Minimal · up to adc20

This adds an opt-in live-test peer mode, with updated usage text, docs and argument tests. No concrete defects were found in the supplied code or the surrounding server code that was inspected. The only unexercised piece is the route-found dialog check, which the author reports being tested separately.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title is a single sentence that names the main change, a peer live test that starts two servers the peering check can route between. It is not overly broad and matches the PR's new peer-reachable …
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description check Passed The description follows the template's sections (Problem, What changed, Live testing, Upstream impact via the checklist, Checklist) and gives a clear reason for the change. It explains that the `--pee…
Full details: Title check

Explanation

The title is a single sentence that names the main change, a peer live test that starts two servers the peering check can route between. It is not overly broad and matches the PR's new peer-reachable mode. The grammar is awkward: 'can start two servers the peering check finds a route between' reads as a relative clause without a clear head, so it is hard to parse at a glance. The scope and meaning still match the changeset.

Full details: Description check

Explanation

The description follows the template's sections (Problem, What changed, Live testing, Upstream impact via the checklist, Checklist) and gives a clear reason for the change. It explains that the --peer mode offers no address, so the 'route found' state cannot be tested, and that --peer --reachable binds both servers to all interfaces (--host ::) to fix this. It documents the live tests at two commits, the tester's results, and what was not exercised (no-tailnet machine). The UI section is omitted with a no-UI-change note, which the template allows. The 'Upstream impact' section is not present as a heading. The author states that no upstream-owned files were edited, so this is a minor gap. The 'End with the model and harness' line is present as 'Claude Fable 5.2, in Claude Code through J5 Code.' The description is mostly complete.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 192739e and adc201f.

Files selected for processing: 2

  • .agents/skills/j5-live-test/SKILL.md
  • scripts/j5/setup-agent-live-test.ts
Files skipped from review as they are similar to previous changes: 1

  • .agents/skills/j5-live-test/SKILL.md

Included review availability: This review used your included allowance. 0 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 4 reviews per hour.

A link's tools take plain http only at a Tailscale name or IPv6 address.
On 0.0.0.0 the servers offered IPv4 addresses only, so the check found a
route for messages that tools were refused on.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@Jacksondr5
Jacksondr5 merged commit fe5c73d into j5/main Nov 21, 2026
35 checks passed
@Jacksondr5
Jacksondr5 deleted the j5code/live-test-peer-reachable branch November 21, 2026 17:48

This branch was successfully deployed

1 active deployment
Preview — adc201fc Deployed Nov 21, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M 30-99 effective changed lines (test files excluded in mixed PRs). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant