The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 21, 19:45 UTC
fix(scripts): mobile:e2e asks Tailscale for the address pool devices reach (#35553)
Julius Marminge committed
Nov 12, 2026 at 11:25 UTC
8b05078459aaa55e95075b93abd8aa00afd2b7b1
1 file changed
+12
-9
scripts/mobile-e2e.ts
+12
-9
@@ -32,14 +32,17 @@ const REPO_ROOT = NodePath.resolve(NodePath.dirname(NodeURL.fileURLToPath(import
32
33
const log = (scope: string, message: string) => NodeProcess.stderr.write(`[${scope}] ${message}\n`);
34
35
-/** This machine's Tailscale address (100.64.0.0/10), which pool devices reach it on. */
36
-function tailnetAddress(): string {
37
- for (const addresses of Object.values(NodeOS.networkInterfaces())) {
38
- for (const address of addresses ?? []) {
39
- const [first, second] = address.address.split(".").map(Number);
40
- if (address.family === "IPv4" && first === 100 && second! >= 64 && second! < 128)
41
- return address.address;
42
- }
35
+/** This machine's Tailscale address, which pool devices reach it on. */
36
+async function tailnetAddress(): Promise<string> {
37
+ // Other VPNs share 100.64.0.0/10, so ask Tailscale instead of matching interface ranges.
38
+ // The macOS app bundles its CLI without putting a launcher on PATH.
39
+ for (const cli of ["tailscale", "/Applications/Tailscale.app/Contents/MacOS/Tailscale"]) {
40
+ const stdout = await run(cli, ["ip", "-4"]).then(
41
+ (result) => result.stdout,
42
+ () => "",
43
+ );
44
+ const address = stdout.trim().split("\n")[0];
45
+ if (address) return address;
46
}
47
throw new Error("No Tailscale IPv4 address: pool devices reach Metro and the fixture over it.");
48
}
@@ -173,7 +176,7 @@ async function main() {
176
throw new Error(
177
"Set SIMLOCK_AGENT_DEVICE_URL (<gateway>/v1/agent-device) and AGENT_DEVICE_DAEMON_AUTH_TOKEN (a Simlock agent token) to run on the device pool.",
178
);
176
- const host = tailnetAddress();
179
+ const host = await tailnetAddress();
180
181
const runId = new Date().toISOString().replaceAll(/[:.]/g, "-");
182
const outputDirectory = NodePath.join(REPO_ROOT, "artifacts/mobile-e2e", runId);