style: format browser tool wiring

This commit is contained in:
Peter Steinberger
2026-01-11 01:34:45 +01:00
parent 07eed3de56
commit b339097179
2 changed files with 4 additions and 12 deletions

View File

@@ -626,9 +626,7 @@ export function createClawdbotCodingTools(options?: {
createWhatsAppLoginTool(),
...createClawdbotTools({
browserControlUrl: sandbox?.browser?.controlUrl,
allowHostBrowserControl: sandbox
? sandbox.browserAllowHostControl
: true,
allowHostBrowserControl: sandbox ? sandbox.browserAllowHostControl : true,
agentSessionKey: options?.sessionKey,
agentProvider: resolveGatewayMessageProvider(options?.messageProvider),
agentAccountId: options?.agentAccountId,

View File

@@ -143,21 +143,15 @@ function resolveBrowserBaseUrl(params: {
const normalizedDefault = params.defaultControlUrl?.trim() ?? "";
const target =
params.target ??
(normalizedControlUrl
? "custom"
: normalizedDefault
? "sandbox"
: "host");
(normalizedControlUrl ? "custom" : normalizedDefault ? "sandbox" : "host");
if (target !== "custom" && params.target && normalizedControlUrl) {
throw new Error(
'controlUrl is only supported with target="custom".',
);
throw new Error('controlUrl is only supported with target="custom".');
}
if (target === "custom") {
if (!normalizedControlUrl) {
throw new Error('Custom browser target requires controlUrl.');
throw new Error("Custom browser target requires controlUrl.");
}
return normalizedControlUrl.replace(/\/$/, "");
}