From b3ef9f52d3816d522ef8e6e7ed5c9dfe29111a36 Mon Sep 17 00:00:00 2001 From: "Builder.io" Date: Tue, 14 Oct 2025 01:49:15 +0000 Subject: [PATCH] Use runtime agent src when fetching script and remove HelloSkip message cgen-a13954061bf944a283ed11c8503b098e --- client/lib/skip-agent.ts | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/client/lib/skip-agent.ts b/client/lib/skip-agent.ts index 656969c9..18ab8317 100644 --- a/client/lib/skip-agent.ts +++ b/client/lib/skip-agent.ts @@ -379,19 +379,22 @@ const loadSkipAgent = async (): Promise => { } try { + const agentSrc = getAgentSrc(); + if (!agentSrc) { + throw new Error("No agent source configured"); + } + const controller = new AbortController(); const timeout = window.setTimeout(() => controller.abort(), 5000); - const response = await fetch(SKIP_AGENT_SRC, { signal: controller.signal }); + const response = await fetch(agentSrc, { signal: controller.signal }); window.clearTimeout(timeout); if (!response.ok) { - throw new Error("Failed to download HelloSkip agent script"); + throw new Error("Failed to download agent script"); } const scriptText = await response.text(); - const blobUrl = URL.createObjectURL( - new Blob([scriptText], { type: "application/javascript" }), - ); + const blobUrl = URL.createObjectURL(new Blob([scriptText], { type: "application/javascript" })); const script = document.createElement("script"); script.id = SKIP_AGENT_SCRIPT_ID;