fix(browser): default control url uses 18791

main
Peter Steinberger 2025-12-13 15:29:39 +00:00
parent 2d36ae6326
commit d7a8d9a1c7
8 changed files with 21 additions and 21 deletions

View File

@ -118,7 +118,7 @@ Optional: enable/configure clawds dedicated browser control (defaults are alr
{ {
browser: { browser: {
enabled: true, enabled: true,
controlUrl: "http://127.0.0.1:18790", controlUrl: "http://127.0.0.1:18791",
color: "#FF4500" color: "#FF4500"
} }
} }

View File

@ -20,7 +20,7 @@ struct ConfigSettings: View {
// clawd browser settings (stored in ~/.clawdis/clawdis.json under "browser") // clawd browser settings (stored in ~/.clawdis/clawdis.json under "browser")
@State private var browserEnabled: Bool = true @State private var browserEnabled: Bool = true
@State private var browserControlUrl: String = "http://127.0.0.1:18790" @State private var browserControlUrl: String = "http://127.0.0.1:18791"
@State private var browserColorHex: String = "#FF4500" @State private var browserColorHex: String = "#FF4500"
@State private var browserAttachOnly: Bool = false @State private var browserAttachOnly: Bool = false
@ -137,7 +137,7 @@ struct ConfigSettings: View {
HStack(spacing: 8) { HStack(spacing: 8) {
Text("Control URL") Text("Control URL")
TextField("http://127.0.0.1:18790", text: self.$browserControlUrl) TextField("http://127.0.0.1:18791", text: self.$browserControlUrl)
.textFieldStyle(.roundedBorder) .textFieldStyle(.roundedBorder)
.frame(width: 320) .frame(width: 320)
.disabled(!self.browserEnabled) .disabled(!self.browserEnabled)
@ -168,7 +168,7 @@ struct ConfigSettings: View {
.help("When enabled, the browser server will only connect if the clawd browser is already running.") .help("When enabled, the browser server will only connect if the clawd browser is already running.")
Text( Text(
"Clawd uses a separate Chrome profile and ports (default 18790/18791) so it wont interfere with your daily browser." "Clawd uses a separate Chrome profile and ports (default 18791/18792) so it wont interfere with your daily browser."
) )
.font(.footnote) .font(.footnote)
.foregroundStyle(.secondary) .foregroundStyle(.secondary)

View File

@ -109,14 +109,14 @@ Clawdis can start a **dedicated, isolated** Chrome/Chromium instance for clawd a
Defaults: Defaults:
- enabled: `true` - enabled: `true`
- control URL: `http://127.0.0.1:18790` (CDP uses `18791`) - control URL: `http://127.0.0.1:18791` (CDP uses `18792`)
- profile color: `#FF4500` (lobster-orange) - profile color: `#FF4500` (lobster-orange)
```json5 ```json5
{ {
browser: { browser: {
enabled: true, enabled: true,
controlUrl: "http://127.0.0.1:18790", controlUrl: "http://127.0.0.1:18791",
color: "#FF4500", color: "#FF4500",
// Advanced: // Advanced:
// headless: false, // headless: false,

View File

@ -23,7 +23,7 @@ Add a dedicated settings section (preferably under **Tools** or its own “Brows
- **Enable clawd browser** (`default: on`) - **Enable clawd browser** (`default: on`)
- When off: no browser is launched, and browser tools return “disabled”. - When off: no browser is launched, and browser tools return “disabled”.
- **Browser control URL** (`default: http://127.0.0.1:18790`) - **Browser control URL** (`default: http://127.0.0.1:18791`)
- Interpreted as the base URL of the local/remote browser-control server. - Interpreted as the base URL of the local/remote browser-control server.
- If the URL host is not loopback, Clawdis must **not** attempt to launch a local browser; it only connects. - If the URL host is not loopback, Clawdis must **not** attempt to launch a local browser; it only connects.
- **Accent color** (`default: #FF4500`, “lobster-orange”) - **Accent color** (`default: #FF4500`, “lobster-orange”)
@ -38,12 +38,13 @@ Optional (advanced, can be hidden behind Debug initially):
Clawdis already uses: Clawdis already uses:
- Gateway WebSocket: `18789` - Gateway WebSocket: `18789`
- WebChat HTTP: `18788` - WebChat HTTP: `18788`
- Bridge (voice/iris): `18790`
For the clawd browser-control server, use “family” ports: For the clawd browser-control server, use “family” ports:
- Browser control HTTP API: `18790` (gateway + 1) - Browser control HTTP API: `18791` (bridge + 1)
- Browser CDP/debugging port: `18791` (control + 1) - Browser CDP/debugging port: `18792` (control + 1)
The user usually only configures the **control URL** (port `18790`). CDP is an internal detail. The user usually only configures the **control URL** (port `18791`). CDP is an internal detail.
## Browser isolation guarantees (non-negotiable) ## Browser isolation guarantees (non-negotiable)
@ -55,7 +56,7 @@ The user usually only configures the **control URL** (port `18790`). CDP is an i
2) **Dedicated ports** 2) **Dedicated ports**
- Never use `9222` (reserved for ad-hoc dev workflows; avoids colliding with `agent-tools/browser-tools`). - Never use `9222` (reserved for ad-hoc dev workflows; avoids colliding with `agent-tools/browser-tools`).
- Default ports are `18790/18791` unless overridden. - Default ports are `18791/18792` unless overridden.
3) **Named tab/page management** 3) **Named tab/page management**
- The agent must be able to enumerate and target tabs deterministically (by stable `targetId` or equivalent), not “last tab”. - The agent must be able to enumerate and target tabs deterministically (by stable `targetId` or equivalent), not “last tab”.
@ -147,4 +148,3 @@ The agent should not assume tabs are ephemeral. It should:
- Cross-device “sync” of tabs between Mac and Pi. - Cross-device “sync” of tabs between Mac and Pi.
- Sharing the users logged-in Chrome sessions automatically. - Sharing the users logged-in Chrome sessions automatically.
- General-purpose web scraping; this is primarily for “close-the-loop” verification and interaction. - General-purpose web scraping; this is primarily for “close-the-loop” verification and interaction.

View File

@ -8,8 +8,8 @@ describe("browser config", () => {
it("defaults to enabled with loopback control url and lobster-orange color", () => { it("defaults to enabled with loopback control url and lobster-orange color", () => {
const resolved = resolveBrowserConfig(undefined); const resolved = resolveBrowserConfig(undefined);
expect(resolved.enabled).toBe(true); expect(resolved.enabled).toBe(true);
expect(resolved.controlPort).toBe(18790); expect(resolved.controlPort).toBe(18791);
expect(resolved.cdpPort).toBe(18791); expect(resolved.cdpPort).toBe(18792);
expect(resolved.controlHost).toBe("127.0.0.1"); expect(resolved.controlHost).toBe("127.0.0.1");
expect(resolved.color).toBe("#FF4500"); expect(resolved.color).toBe("#FF4500");
expect(shouldStartLocalBrowserServer(resolved)).toBe(true); expect(shouldStartLocalBrowserServer(resolved)).toBe(true);
@ -17,7 +17,7 @@ describe("browser config", () => {
it("normalizes hex colors", () => { it("normalizes hex colors", () => {
const resolved = resolveBrowserConfig({ const resolved = resolveBrowserConfig({
controlUrl: "http://localhost:18790", controlUrl: "http://localhost:18791",
color: "ff4500", color: "ff4500",
}); });
expect(resolved.color).toBe("#FF4500"); expect(resolved.color).toBe("#FF4500");
@ -25,7 +25,7 @@ describe("browser config", () => {
it("falls back to default color for invalid hex", () => { it("falls back to default color for invalid hex", () => {
const resolved = resolveBrowserConfig({ const resolved = resolveBrowserConfig({
controlUrl: "http://localhost:18790", controlUrl: "http://localhost:18791",
color: "#GGGGGG", color: "#GGGGGG",
}); });
expect(resolved.color).toBe("#FF4500"); expect(resolved.color).toBe("#FF4500");
@ -33,7 +33,7 @@ describe("browser config", () => {
it("treats non-loopback control urls as remote", () => { it("treats non-loopback control urls as remote", () => {
const resolved = resolveBrowserConfig({ const resolved = resolveBrowserConfig({
controlUrl: "http://example.com:18790", controlUrl: "http://example.com:18791",
}); });
expect(shouldStartLocalBrowserServer(resolved)).toBe(false); expect(shouldStartLocalBrowserServer(resolved)).toBe(false);
}); });
@ -48,7 +48,7 @@ describe("browser config", () => {
it("rejects unsupported protocols", () => { it("rejects unsupported protocols", () => {
expect(() => expect(() =>
resolveBrowserConfig({ controlUrl: "ws://127.0.0.1:18790" }), resolveBrowserConfig({ controlUrl: "ws://127.0.0.1:18791" }),
).toThrow(/must be http/i); ).toThrow(/must be http/i);
}); });
}); });

View File

@ -1,5 +1,4 @@
export const DEFAULT_CLAWD_BROWSER_ENABLED = true; export const DEFAULT_CLAWD_BROWSER_ENABLED = true;
export const DEFAULT_CLAWD_BROWSER_CONTROL_URL = "http://127.0.0.1:18790"; export const DEFAULT_CLAWD_BROWSER_CONTROL_URL = "http://127.0.0.1:18791";
export const DEFAULT_CLAWD_BROWSER_CDP_PORT = 18791;
export const DEFAULT_CLAWD_BROWSER_COLOR = "#FF4500"; export const DEFAULT_CLAWD_BROWSER_COLOR = "#FF4500";
export const DEFAULT_CLAWD_BROWSER_PROFILE_NAME = "clawd"; export const DEFAULT_CLAWD_BROWSER_PROFILE_NAME = "clawd";

View File

@ -51,7 +51,7 @@ export type WebChatConfig = {
export type BrowserConfig = { export type BrowserConfig = {
enabled?: boolean; enabled?: boolean;
/** Base URL of the clawd browser control server. Default: http://127.0.0.1:18790 */ /** Base URL of the clawd browser control server. Default: http://127.0.0.1:18791 */
controlUrl?: string; controlUrl?: string;
/** Accent color for the clawd browser profile (hex). Default: #FF4500 */ /** Accent color for the clawd browser profile (hex). Default: #FF4500 */
color?: string; color?: string;

View File

@ -148,6 +148,7 @@ describe("CronService", () => {
vi.setSystemTime(new Date("2025-12-13T00:00:01.000Z")); vi.setSystemTime(new Date("2025-12-13T00:00:01.000Z"));
await vi.runOnlyPendingTimersAsync(); await vi.runOnlyPendingTimersAsync();
await cron.list({ includeDisabled: true });
expect(enqueueSystemEvent).toHaveBeenCalledWith( expect(enqueueSystemEvent).toHaveBeenCalledWith(
"Cron (error): last output", "Cron (error): last output",