openclaw/openclaw · error · Error

--driver must be openclaw or existing-session

Error message

--driver must be openclaw or existing-session

What it means

Thrown by the `profiles create` Browser CLI handler when `--driver` is supplied with any value other than `openclaw` or `existing-session`. Those are the only two supported profile drivers; anything else is rejected before the POST /profiles/create request is dispatched.

Source

Thrown at extensions/browser/src/cli/browser-cli-manage.ts:818

    .action(
      async (
        opts: {
          name: string;
          color?: string;
          cdpUrl?: string;
          userDataDir?: string;
          driver?: string;
        },
        cmd,
      ) => {
        const parent = parentOpts(cmd);
        await runBrowserCommand(async () => {
          if (
            opts.driver !== undefined &&
            opts.driver !== "openclaw" &&
            opts.driver !== "existing-session"
          ) {
            throw new Error("--driver must be openclaw or existing-session");
          }
          const result = await callBrowserRequest<BrowserCreateProfileResult>(
            parent,
            {
              method: "POST",
              path: "/profiles/create",
              body: {
                name: opts.name,
                color: opts.color,
                cdpUrl: opts.cdpUrl,
                userDataDir: opts.userDataDir,
                driver: opts.driver === "existing-session" ? "existing-session" : undefined,
              },
            },
            { timeoutMs: 10_000 },
          );
          if (printJsonResult(parent, result)) {
            return;

View on GitHub (pinned to 01804a7531)

Solutions

  1. Use `--driver openclaw` (default managed browser) or `--driver existing-session` (attach to an already-running CDP session).
  2. Omit `--driver` entirely to get the default `openclaw` driver.
  3. If you meant to attach to an existing session, ensure you also provide `--cdp-url` as needed for `existing-session`.

Example fix

// before
openclaw browser profiles create --name mine --driver chromium

// after
openclaw browser profiles create --name mine --driver openclaw
Defensive patterns

Strategy: validation

Validate before calling

const ALLOWED_DRIVERS = new Set(["openclaw", "existing-session"]);
function assertDriverAllowed(driver: string | undefined) {
  if (driver !== undefined && !ALLOWED_DRIVERS.has(driver)) {
    throw new Error(`--driver must be one of: ${[...ALLOWED_DRIVERS].join(", ")}`);
  }
}

Type guard

function isSupportedBrowserDriver(value: unknown): value is "openclaw" | "existing-session" {
  return value === "openclaw" || value === "existing-session";
}

Prevention

When it happens

Trigger: Running `openclaw browser profiles create --driver <something>` where `<something>` is not exactly `openclaw` or `existing-session` (e.g. a typo like `openclw`, `chromium`, or `puppeteer`).

Common situations: Typing the driver name, guessing a driver value from another tool (e.g. `selenium`, `playwright`), or passing an empty/whitespace string after `--driver`.

Related errors


AI-assisted analysis of openclaw/openclaw@01804a7531 (2026-08-12). Data as JSON: /api/errors/68164dcbfccd9cc4. Report an issue: GitHub.