You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 40f36fd
Browse filesBrowse the repository at this point in the historyBrowse files
feat: tell agents where the user is and where the dev server runs
User messages from clients now carry a server-stamped sentFrom (client
surface, OS, device, connection method, dialed host, machine label).
Turn start puts a one-line <sent_from> note ahead of the prompt so agents
pick localhost or tailnet links correctly. runtime_info gains a hint that
bare UUIDs are T3 thread IDs. The dev runner writes <T3 home>/dev-runner.json
with ports, URLs, and reusable-token pairing links.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Copy file name to clipboardExpand all lines: AGENTS.md
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -79,7 +79,8 @@ The most common defect in this repo is a change that works on the path you teste
79
79
80
80
-`vp i` installs. Worktrees get this from the t3.json setup script; if module resolution looks broken, it probably did not run.
81
81
-`vp run dev` starts server and web. In a worktree, state defaults to that worktree's gitignored `.t3`, which deliberately outranks an ambient `T3CODE_HOME` so you cannot land on shared state by accident. An explicit `--home-dir` still wins.
82
-
- Ports derive from the worktree path and are stable across restarts, but read the real ones from the `[dev-runner]` line since occupied ports shift.
82
+
- Ports derive from the worktree path and are stable across restarts, but occupied ports shift. While the runner is up, read the real ports and URLs from `.t3/dev-runner.json` (in the T3 home, so `--home-dir` moves it) instead of polling the log. Its `pid` tells you whether the runner is still alive; signalling only that PID leaves Vite and the server running. It also holds pairing URLs when a reusable dev token is set. Those URLs are admin credentials: give them only to the user.
83
+
- User messages can start with `<sent_from>`, which says where the user is. Give a remote user tailnet (`--share`) links, not localhost.
83
84
- Sharing over the tailnet is three steps: run `vp run dev --share` in the background, wait for the `pairingUrl:` line in its output, then give that full URL to an unpaired browser. Do not wire up `tailscale serve` by hand, open the URL yourself, or consume the user's pairing link. A browser with the reusable dev cookie can use the bare origin. If a normal one-time token was consumed, mint a fresh one with `node apps/server/src/bin.ts pair`. It carries standard scopes, while the startup URL carries admin scopes needed for Connections settings.
84
85
- To reuse web dev auth across worktrees, configure one fixed `T3CODE_DEV_AUTH_TOKEN` in the main checkout's gitignored `.env`. The `t3.json` setup links that file into worktrees. Never commit or publish the token or a startup URL. See [Reusable dev credential](docs/operations/development.md#reusable-dev-credential).
85
86
- Stop what you started, by the PID you tracked. See rule 1.
it("says localhost works when the client dialed loopback directly",()=>{
7
+
assert.equal(
8
+
formatSentFromContext({
9
+
surface: "desktop",
10
+
os: "macOS",
11
+
connectionMethod: "direct",
12
+
host: "127.0.0.1:3773",
13
+
serverLabel: "Mainbook",
14
+
}),
15
+
"<sent_from>The user sent this message from the T3 Code desktop app on macOS to this machine (Mainbook) at 127.0.0.1:3773. The user is at this machine, so localhost URLs work for them.</sent_from>",
16
+
);
17
+
});
18
+
19
+
it("points at the dialed name when the client is elsewhere on the network",()=>{
0 commit comments