fix: gateway summary lookup + test browser opens

This commit is contained in:
Peter Steinberger
2026-01-23 05:54:32 +00:00
parent bd7443b39b
commit 9f6ea67415
5 changed files with 27 additions and 9 deletions

View File

@@ -192,6 +192,7 @@ function resolveSshTargetHint(): string {
}
export async function openUrl(url: string): Promise<boolean> {
if (shouldSkipBrowserOpenInTests()) return false;
const resolved = await resolveBrowserOpenCommand();
if (!resolved.argv) return false;
const quoteUrl = resolved.quoteUrl === true;
@@ -218,6 +219,7 @@ export async function openUrl(url: string): Promise<boolean> {
}
export async function openUrlInBackground(url: string): Promise<boolean> {
if (shouldSkipBrowserOpenInTests()) return false;
if (process.platform !== "darwin") return false;
const resolved = await resolveBrowserOpenCommand();
if (!resolved.argv || resolved.command !== "open") return false;
@@ -308,6 +310,12 @@ export async function detectBinary(name: string): Promise<boolean> {
}
}
function shouldSkipBrowserOpenInTests(): boolean {
if (process.env.CLAWDBOT_ALLOW_TEST_BROWSER_OPEN) return false;
if (process.env.VITEST) return true;
return process.env.NODE_ENV === "test";
}
export async function probeGatewayReachable(params: {
url: string;
token?: string;