diff --git a/scripts/dev/realtime-talk-live-smoke.ts b/scripts/dev/realtime-talk-live-smoke.ts index a724a9dade36..17449d477e19 100644 --- a/scripts/dev/realtime-talk-live-smoke.ts +++ b/scripts/dev/realtime-talk-live-smoke.ts @@ -213,6 +213,10 @@ function transcriptIncludesMarker(transcripts: string[], marker: string): boolea return normalizeTranscript(transcripts.join(" ")).includes(normalizeTranscript(marker)); } +function resolveGatewayRelayModulePath(repoRoot = process.cwd()): string { + return `/@fs/${repoRoot.replaceAll("\\", "/")}/ui/src/pages/chat/realtime-talk-gateway-relay.ts`; +} + async function sendPcmAudioInChunks( bridge: RealtimeVoiceBridge, audio: Buffer, @@ -899,10 +903,7 @@ async function smokeGatewayRelayBrowser(browser: Browser): Promise const dir = await mkdtemp(path.join(tmpdir(), "openclaw-realtime-talk-")); try { const { createServer } = await import("vite"); - const repoRoot = process.cwd().replaceAll("\\", "/"); - const relayModulePath = JSON.stringify( - `/@fs/${repoRoot}/ui/src/ui/chat/realtime-talk-gateway-relay.ts`, - ); + const relayModulePath = JSON.stringify(resolveGatewayRelayModulePath()); await writeFile( path.join(dir, "index.html"), '', @@ -1154,6 +1155,7 @@ export const testing = { parseRealtimeSmokeArgs, readOpenAIRealtimeBrowserResponseText, readBoundedText, + resolveGatewayRelayModulePath, resolveOpenAIHttpTimeoutMs, sendPcmAudioInChunks, transcriptIncludesMarker,