aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorIgor Soarez <igor@soarez.org>2026-10-15 22:25:41 +0100
committerIgor Soarez <igor@soarez.org>2026-10-15 22:25:41 +0100
commit08c0c3a8b4fe755f7fe65ea8d258d77971503882 (patch)
tree7f426ef10074429cc12facba4c0c23d30ea8475c /src
parent3e761274fe7b0e6be4a162e880293150ad9d9fbe (diff)
fix(cdp): give the castle default 1.5s, not 5s, inside upstream's connect budget
Diffstat (limited to 'src')
-rw-r--r--src/cdp/discovery.ts6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/cdp/discovery.ts b/src/cdp/discovery.ts
index 84da5f9..7aa35f6 100644
--- a/src/cdp/discovery.ts
+++ b/src/cdp/discovery.ts
@@ -133,7 +133,11 @@ export const discoverEndpoint = async (): Promise<Result<CdpEndpoint, CdpError>>
return err(cdpError("discovery_failed", describeCdpTarget(target)));
}
if (target.kind === "remote") {
- const ws = await queryLiveWsUrl(target.port, 5_000, target.host);
+ // FORK: the default is only a preference, and this probe now runs inside the
+ // bridge's 10s connect budget (upstream starts that timer before discovery), so
+ // a blackholed castle must not eat the local fallback's time. Explicit targets
+ // keep the longer wait: they fail hard rather than fall back.
+ const ws = await queryLiveWsUrl(target.port, target.source === "default" ? 1_500 : 5_000, target.host);
if (ws) return ok({ wsUrl: ws });
// An explicitly configured endpoint is an instruction: fail rather than