Skip to content

Agent live testing: one setup script, the Browser panel, and a testing skill #546

Closed

Description

@Jacksondr5

Problem

Agents that work on J5 Code need to live-test on real servers with real provider agents; unit tests only go so far. A review of 96 past threads that did live testing (2026-09-08 to 2026-10-11) found that live testing reliably catches bugs green unit suites miss, but that every tester rebuilds the same rig by hand, and that the rig has put real repositories at risk.

What the review found:

  • Every tester rewrites the same harness. One reviewer wrote 170 ad hoc scripts and another about 118: a browser driver, a WebSocket client, SQL to stand down a copied database, server start and stop, and the evidence upload.
  • Copies of real data reach real things. Test agents left branches and worktrees in the real j5code and trade-tracker repositories. On 2026-10-03 copied threads started real Claude sessions. A turn on a copied thread also resumes the developer's real provider session and appends to it.
  • The test-t3-app skill is out of date. It names .t3 paths, and tells agents to stop when the Browser panel reports unavailable. Several testers stopped there.
  • About half of each tester brief is host boilerplate, and Jackson granted live-agent permission by hand 11 times and asked "what couldn't you test?" 12 times.
  • Peering, remote connections and desktop had almost no live coverage.

Two things changed during the review:

The plan

An agent that needs to live-test runs one script and follows what it prints. The script builds a safe, self-contained test server in the agent's own worktree. The agent drives it through the Browser panel.

Decisions (Jackson, 2026-10-11)

  • Use the Browser panel, as upstream does.
  • Two modes. Agent testing uses a test repo and pre-made threads only, with nothing real reachable. --for-dev uses a copy of the developer's data for a server the developer uses; the agent takes no turns on it.
  • Pre-made threads are for viewing. Live turns go in new threads.
  • Each tester gets its own copy of the test repo and home, inside its worktree's .j5code.
  • Testers are peer agents, not native subagents. The builder commits first and the tester's worktree starts from that commit.
  • Claude Haiku and GPT Luna need no permission for live turns. A more expensive model is raised to Jackson first. The test home defaults new threads to Haiku.
  • Extra test passes are conditional on what the change touches, and the report lists each as run or not applicable with a reason.
  • Restart tests happen only at rest, or during a turn held open by a gate. Narrow windows such as mid-migration belong in deterministic tests.
  • The tester saves its report as an artifact and sends a short message pointing to it.
  • Two skills, both referenced from AGENTS.md.

Work

Conditional passes

Always: the feature's own flow including the way back out, and one real turn sent through the UI.

When the change touches Also run
The turn path, provider adapters or MCP tools One turn each on Codex and Claude
Stored state, deliveries or recovery Restart at rest, then use the state; for interrupted runs, also restart during a gated turn
Migrations A migration rehearsal on a copy, plus a --fresh run
Startup, onboarding or settings defaults A --fresh run
Anything an agent is meant to use Ask a real agent in plain language, without naming the tool
Peering or cross-server messaging A --peer run
UI, after a rebase or review fixes that touched it Re-run the browser pass before merge

Not testable with this plan

  • The desktop app: Electron, the packaged build, the updater and installers. A human verifies these.
  • Relay and tunnel connections, a second physical machine, an unreachable peer.
  • Continuing a pre-made thread, and real diffs inside pre-made threads.
  • Behaviour under the developer's real data volume.
  • Providers other than Codex and Claude on this host.
  • Timer-driven features at real speed.

Unproven

  • A dev server correctly rendering a replay-built home.
  • pr-env.sh's peering steps working from a worktree on current j5/main.
  • The narrowed watch not following node_modules symlinks under packages.
  • Thread-created worktrees staying inside the tester's .j5code, and worktree removal deleting it.
  • The browser staying paired across a restart.
  • Which setting controls the default model for new threads.

Parked

  • Video in PRs: the panel records MP4, which GitHub does not play from a raw link.
  • Desktop testing.
  • Bulk seeding for volume tests.
  • Two possible upstream reports: the "do not retry, use Playwright" error text that is out of date now the server has its own browser, and a timed-out panel action evicting the whole browser host.
  • A scripted ACP mock provider for free, deterministic interactive tests.

Host

vp run dev --share fails for the dev user on Tailscale Serve permissions. Jackson is handling this separately.

Mobile is out of scope.

Planned with Claude Opus 5.5 in Claude Code.

Activity

  1. added
    enhancement
    on Oct 12, 2026
  2. Jacksondr5 commented on Oct 12, 2026

    @Jacksondr5
    OwnerAuthor

    Findings from the vp run dev --share investigation on the dev host (2026-10-11), relevant to --for-dev:

    • Permission: fixed. tailscale serve was refused because no operator was set. Jackson ran sudo tailscale set --operator=j5dev. --share now starts, prints a tailnet pairing URL, and removes its mapping on SIGTERM.
    • Ports: open. The host's tailnet policy allows inbound TCP 22, 8443 and 8444 only. --share serves on the worktree's derived web port (5734 to 8733), so the shared URL is unreachable from other devices. Confirmed from a second device: the worktree port timed out, and a temporary mapping on 8443 to the same server returned 200. 8444 is the live install. Two options are with Jackson: a policy rule allowing the derived range, or serving on a fixed allowed port, which permits one shared server at a time.
    • A manual mapping works today: tailscale serve --bg --https=8443 http://localhost:<webPort>, removed with tailscale serve --https=8443 off. The printed pairing URL then carries the wrong port, and pairing through 8443 was not verified.

    For the setup script:

    • --for-dev could own the fixed-port mapping itself (create it on start, remove it on stop, print the pairing URL with the right port), with no change to upstream's dev runner.
    • The operator setting gives the dev user the whole Tailscale local API. The script must touch only its own mapping, never 8444, and never serve reset.
    • A local curl to the shared origin proves nothing, because local traffic bypasses the policy. Reachability has to be checked from another device.
    • If sharing fails, the dev runner only logs a warning and keeps running unshared, so the script should check for the "shared on tailnet:" line.
    • setsid cmd & forks, so $! is not the process group. Record it with setsid sh -c 'echo $$ > pgid.file; exec …'.
    • vp is not on PATH on this host, so the worktree setup script can fail silently and leave no node_modules.
  3. Jacksondr5 commented on Oct 12, 2026

    @Jacksondr5
    OwnerAuthor

    Update on sharing (2026-10-11): the port problem is fixed too, so the 8443 workaround above no longer applies.

    • The tailnet policy for the dev host now allows Jackson's devices to reach TCP 5734-5772 and 5774-8733, which covers every web port the dev runner derives for a worktree. Port 5773, the live install's, is deliberately excluded.
    • Verified from a second device against a worktree dev server shared on its derived port: the origin returns 200, and an unpaired browser lands on the pairing screen. Pairing with the startup URL by Jackson is the one step not yet confirmed.
    • vp run dev --share therefore works as documented, with no manual tailscale serve step. --for-dev can use it directly and does not need to own a fixed-port mapping.
    • Only Jackson's own devices are allowed. An unpaired browser shows the splash screen for several seconds before the pairing screen appears.
    • Still true: touch only your own port's mapping; a local curl does not prove reachability; a failed share only logs a warning.
  4. Jacksondr5 commented on Oct 12, 2026

    @Jacksondr5
    OwnerAuthor

    The "New worktree" first-turn fault from the spike has a mechanism, and it is not a test-home problem (builder's trace, 2026-10-12; 3 of 3 reproductions on the script-built home, not yet reproduced on a plain home).

    • In apps/web/src/components/BranchToolbarBranchSelector.tsx (about 540-550), the effect that defaults the worktree base calls setThreadBranch(candidate, null, true) when the thread shows no worktree path and no branch. Once a server thread exists, that sends updateThreadMetadata({ branch, worktreePath: null }).
    • When a message is sent within a second or two of choosing "New worktree", that client command lands about 50 ms after the server attaches the provider session to the new worktree. Orchestrator.ts (about 3345) sees the worktree path change and detaches the session with "Workspace changed.", which interrupts the turn. The later branch rename restores the path.
    • Live use does not show it: 19 of 19 first runs of worktree threads completed since 2026-10-10, 10 of them started from the web UI, and the event log has one "Workspace changed." detach, from 2026-09-12. The likely reason is that a person does not send that quickly; this is not confirmed.

    So it is a race in upstream's web client that automation hits and people have not. The setup script tells testers to take live turns in "Current checkout". No J5 fix, in line with not patching upstream behaviour that has not hit real use. Parked as a possible upstream report, with a plain-home reproduction still to do.

  5. 189 remaining items

  6. Jacksondr5 commented on Oct 12, 2026

    @Jacksondr5
    OwnerAuthor

    --for-dev reachability is verified end to end (2026-10-12): Jackson opened the tailnet pairing link from another device, it paired, and he could navigate the copied threads. The server was then stopped, its own tailnet mapping was removed, the installed server's mapping was unchanged, and the copy was replaced with the default test home.

    Merged so far: #550 (watch), #548 (server name), #551 (default mode), #554 (--fresh), #555 (--peer, --poll), #556 (--for-dev). Remaining: #558 (--base), #559 (evidence upload), then the skills and AGENTS.md PR #549 and the cold-run check.

  7. Jacksondr5 commented on Oct 12, 2026

    @Jacksondr5
    OwnerAuthor

    Done (2026-10-12). Merged: #550 (watch), #548 (server name), #551 (setup script, default mode), #554 (--fresh), #555 (--peer, --poll), #556 (--for-dev), #558 (--base), #559 (evidence upload), #549 (skills, AGENTS.md, PR template).

    Acceptance check: two brand-new agents, one on Claude and one on Codex, each live-tested a change from a one-line brief using the skills alone.

    Still parked, as listed above: video in PRs; desktop testing; bulk seeding for volume tests; a scripted mock provider; the "New worktree" first-turn race in upstream's web client (not reproduced on a plain home); the stale "do not retry, use Playwright" panel error text and the browser host being evicted when an action times out (possible upstream reports). The native-agent-tools channel is tracked in #336, and the --share port collision in #276.

    Known limits of the script: Linux only; it does not install dependencies; a first turn in "New worktree" mode can be interrupted or hang; --base leaves a registered, detached worktree of the repository until rebuild.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions