From 536631b9a39b1c2999b10e344e7d74d86fac3180 Mon Sep 17 00:00:00 2001 From: "Builder.io" Date: Tue, 14 Oct 2025 01:54:45 +0000 Subject: [PATCH] Guard skip-agent against loading on /docs routes cgen-7927c68f94774975911966b96a133f39 --- client/lib/skip-agent.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/client/lib/skip-agent.ts b/client/lib/skip-agent.ts index 81707c25..7f192969 100644 --- a/client/lib/skip-agent.ts +++ b/client/lib/skip-agent.ts @@ -213,11 +213,24 @@ const createSkipAgentTheme = () => { document.head.appendChild(style); }; +const isDocsPath = () => { + try { + return typeof window !== "undefined" && window.location.pathname.startsWith("/docs"); + } catch (e) { + return false; + } +}; + const isSkipAgentReachable = async (): Promise => { if (!shouldEnableSkipAgent) { return false; } + if (isDocsPath()) { + // Never check or initialize the agent from documentation routes. + return false; + } + const controller = new AbortController(); const timeout = window.setTimeout(() => controller.abort(), 4000);