The ultimate harness for coding agents and beyond. All your agents. All your machines. One command center. Start with code, then follow your curiosity and build across disciplines: CAD, circuits, robots, games and music.
TypeScript 3d-modelingagent-frameworkagent-harnessai-agentscadclaude-codecodexcoding-agentsdeveloper-toolsesp32game-developmentmcp-servermulti-agentopen-hardwareopencodeopenharnesspcbroboticsterminaltmux
fix: increase STUN URL capture limit from 4/8 to 10 to align with backend configurations and prevent silent URL dropping
0xken1562aa681543d8
diff --git a/cli/src/lib/remoteRelay.ts b/cli/src/lib/remoteRelay.tsindex f12fd9c26..e2737009c 100644--- a/cli/src/lib/remoteRelay.ts+++ b/cli/src/lib/remoteRelay.ts@@ -141,8 +141,13 @@ function p2pPolicy(value: unknown): TerminalP2pPolicy | null {if (!value || typeof value !== 'object') return nullconst raw = value as Record<string, unknown>if (raw.enabled !== true || raw.protocolVersion !== TERMINAL_P2P_PROTOCOL_VERSION) return null+ // Regression: this used to cap at 4 while the responder's own parsing of the resulting offer+ // (buildResponderEntry in terminalP2p.ts) caps at 10 — since the offer only ever carries what THIS+ // cap let through, half of whatever the backend configured was silently dropped before an offer was+ // ever built, and the responder's higher ceiling was unreachable in practice. Kept in step with that+ // one and with the backend's own default list length (autonomous-harness-backend/src/config/env.ts).const stunUrls = Array.isArray(raw.stunUrls)- ? raw.stunUrls.filter((url): url is string => typeof url === 'string' && /^stuns?:/i.test(url)).slice(0, 4)+ ? raw.stunUrls.filter((url): url is string => typeof url === 'string' && /^stuns?:/i.test(url)).slice(0, 10): []const openWaitMs = typeof raw.openWaitMs === 'number' && Number.isSafeInteger(raw.openWaitMs)? Math.max(0, Math.min(5_000, raw.openWaitMs))diff --git a/cli/src/lib/terminalP2p.spec.ts b/cli/src/lib/terminalP2p.spec.tsindex 8b2ccd254..aeef757b4 100644--- a/cli/src/lib/terminalP2p.spec.ts+++ b/cli/src/lib/terminalP2p.spec.ts@@ -169,12 +169,13 @@ describe('terminal WebRTC data channel', () => {'stun:1.example:3478', 'stun:2.example:3478', 'stun:3.example:3478','stun:4.example:3478', 'stun:5.example:3478', 'stun:6.example:3478','stun:7.example:3478', 'stun:8.example:3478', 'stun:9.example:3478',- 'turn:10.example:3478', 42,+ 'stun:10.example:3478', 'stun:11.example:3478', 'turn:12.example:3478', 42,] as unknown as string[],})expect(selectStunUrls).toHaveBeenCalledWith(['stun:1.example:3478', 'stun:2.example:3478', 'stun:3.example:3478', 'stun:4.example:3478','stun:5.example:3478', 'stun:6.example:3478', 'stun:7.example:3478', 'stun:8.example:3478',+ 'stun:9.example:3478', 'stun:10.example:3478', // the 11th valid stun: url is capped off])} finally {await responder.stop()diff --git a/cli/src/lib/terminalP2p.ts b/cli/src/lib/terminalP2p.tsindex 6fd33964c..0f9b30214 100644--- a/cli/src/lib/terminalP2p.ts+++ b/cli/src/lib/terminalP2p.ts@@ -663,8 +663,11 @@ export class TerminalP2pResponderPool {payload: TerminalP2pSignal,stillCurrent: () => boolean,): Promise<ResponderEntry | null> {+ // Kept in step with remoteRelay.ts's own cap on the offerer's side (p2pPolicy()'s stunUrls slice)+ // and with the backend's default STUN list length — see that file's comment for why the two must+ // match: this ceiling is unreachable in practice if the offerer's own is lower.const offeredStunUrls = Array.isArray(payload.stunUrls)- ? payload.stunUrls.filter((url): url is string => typeof url === 'string' && /^stuns?:/i.test(url)).slice(0, 8)+ ? payload.stunUrls.filter((url): url is string => typeof url === 'string' && /^stuns?:/i.test(url)).slice(0, 10): []// The offerer raced these too, and may well have landed on a different server. That is fine: a// srflx candidate is each peer's own public address, so the two sides need not agree on who to ask.