{"record":{"id":"68164dcbfccd9cc4","repo":"openclaw/openclaw","slug":"driver-must-be-openclaw-or-existing-session","errorCode":null,"errorMessage":"--driver must be openclaw or existing-session","messagePattern":"--driver must be openclaw or existing-session","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"extensions/browser/src/cli/browser-cli-manage.ts","lineNumber":818,"sourceCode":"    .action(\n      async (\n        opts: {\n          name: string;\n          color?: string;\n          cdpUrl?: string;\n          userDataDir?: string;\n          driver?: string;\n        },\n        cmd,\n      ) => {\n        const parent = parentOpts(cmd);\n        await runBrowserCommand(async () => {\n          if (\n            opts.driver !== undefined &&\n            opts.driver !== \"openclaw\" &&\n            opts.driver !== \"existing-session\"\n          ) {\n            throw new Error(\"--driver must be openclaw or existing-session\");\n          }\n          const result = await callBrowserRequest<BrowserCreateProfileResult>(\n            parent,\n            {\n              method: \"POST\",\n              path: \"/profiles/create\",\n              body: {\n                name: opts.name,\n                color: opts.color,\n                cdpUrl: opts.cdpUrl,\n                userDataDir: opts.userDataDir,\n                driver: opts.driver === \"existing-session\" ? \"existing-session\" : undefined,\n              },\n            },\n            { timeoutMs: 10_000 },\n          );\n          if (printJsonResult(parent, result)) {\n            return;","sourceCodeStart":800,"sourceCodeEnd":836,"githubUrl":"https://github.com/openclaw/openclaw/blob/01804a75319da4b69c9ab98ceaa30477e22b8c0b/extensions/browser/src/cli/browser-cli-manage.ts#L800-L836","documentation":"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.","triggerScenarios":"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`).","commonSituations":"Typing the driver name, guessing a driver value from another tool (e.g. `selenium`, `playwright`), or passing an empty/whitespace string after `--driver`.","solutions":["Use `--driver openclaw` (default managed browser) or `--driver existing-session` (attach to an already-running CDP session).","Omit `--driver` entirely to get the default `openclaw` driver.","If you meant to attach to an existing session, ensure you also provide `--cdp-url` as needed for `existing-session`."],"exampleFix":"// before\nopenclaw browser profiles create --name mine --driver chromium\n\n// after\nopenclaw browser profiles create --name mine --driver openclaw","handlingStrategy":"validation","validationCode":"const ALLOWED_DRIVERS = new Set([\"openclaw\", \"existing-session\"]);\nfunction assertDriverAllowed(driver: string | undefined) {\n  if (driver !== undefined && !ALLOWED_DRIVERS.has(driver)) {\n    throw new Error(`--driver must be one of: ${[...ALLOWED_DRIVERS].join(\", \")}`);\n  }\n}\n","typeGuard":"function isSupportedBrowserDriver(value: unknown): value is \"openclaw\" | \"existing-session\" {\n  return value === \"openclaw\" || value === \"existing-session\";\n}","tryCatchPattern":null,"preventionTips":["Restrict driver selection to a typed enum in UIs/wrappers.","Omit --driver to take the default rather than guessing a value.","Validate user-provided driver strings against the allow-list before invoking the CLI."],"tags":["cli","browser","validation","enum"],"backgroundTag":null,"analyzedSha":"01804a75319da4b69c9ab98ceaa30477e22b8c0b","analyzedAt":"2026-08-12T04:37:58.197Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}