Skip to content

fix(config): accept "openclaw" as browser profile driver in Zod schema#39374

Merged
altaywtf merged 4 commits intoopenclaw:mainfrom
gambletan:fix/browser-driver-schema
Mar 8, 2026
Merged

fix(config): accept "openclaw" as browser profile driver in Zod schema#39374
altaywtf merged 4 commits intoopenclaw:mainfrom
gambletan:fix/browser-driver-schema

Conversation

@gambletan
Copy link
Copy Markdown
Contributor

Summary

  • Adds "openclaw" as an accepted value for browser.profiles.*.driver in the Zod config schema
  • Keeps legacy "clawd" as accepted for backwards compatibility
  • Updates schema help text and test to reflect the new valid option

Problem

The project was renamed from "clawd" to "openclaw" but the browser profile driver schema was not updated. The TypeScript type definition (types.browser.ts:7) already defines driver?: "openclaw" | "extension", and runtime code defaults to "openclaw", but the Zod schema only accepted "clawd" — causing validation errors for users who set driver: "openclaw".

Fixes #35620

Test plan

  • Schema help quality tests pass (20/20)
  • Zod schema tests pass (12/12)
  • openclaw config set 'browser.profiles.default.driver' openclaw should succeed

🤖 Generated with Claude Code

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Mar 8, 2026

Greptile Summary

This PR correctly fixes a schema validation gap introduced by the project rename from "clawd" to "openclaw" — the Zod schema now accepts "openclaw" as a valid browser.profiles.*.driver value while retaining "clawd" for backwards compatibility, and the help text and quality test are updated to match.

Key finding:

  • The Zod schema (zod-schema.ts) accepts "openclaw" | "clawd" | "extension", but the hand-written TypeScript type in types.browser.ts only declares driver?: "openclaw" | "extension""clawd" is not in the TypeScript union. Any code consuming BrowserProfileConfig typed values won't be aware that "clawd" is a valid runtime value, which undermines the backwards-compatibility guarantee at the type level.

Confidence Score: 3/5

  • Safe to merge but has a type inconsistency that should be addressed to maintain full type safety for legacy driver values.
  • The core fix is correct and resolves a real user-facing validation error. The backwards-compat intent is sound. However, the TypeScript type definition in types.browser.ts is not updated alongside the Zod schema — "clawd" is missing from the driver union type — which means type-safe code consuming parsed config values will be unaware that "clawd" is a valid value.
  • src/config/types.browser.ts — needs "clawd" added to the driver union type to match the Zod schema's accepted values.

Last reviewed commit: 1c17335

@alvinttang
Copy link
Copy Markdown

Fixed — added "clawd" to the BrowserDriverType union in types.browser.ts to keep the TypeScript type in sync with the Zod schema.

@altaywtf altaywtf self-assigned this Mar 8, 2026
@altaywtf altaywtf force-pushed the fix/browser-driver-schema branch from ac6934f to cc4b702 Compare March 8, 2026 08:54
@altaywtf altaywtf force-pushed the fix/browser-driver-schema branch from 2fa761e to 0eba5ab Compare March 8, 2026 09:04
@altaywtf altaywtf merged commit e5fdfec into openclaw:main Mar 8, 2026
10 checks passed
@altaywtf
Copy link
Copy Markdown
Member

altaywtf commented Mar 8, 2026

Merged via squash.

Thanks @gambletan!

Saitop pushed a commit to NomiciAI/openclaw that referenced this pull request Mar 8, 2026
openclaw#39374)

Merged via squash.

Prepared head SHA: 0eba5ab
Co-authored-by: gambletan <[email protected]>
Co-authored-by: altaywtf <[email protected]>
Reviewed-by: @altaywtf
GordonSH-oss pushed a commit to GordonSH-oss/openclaw that referenced this pull request Mar 9, 2026
openclaw#39374)

Merged via squash.

Prepared head SHA: 0eba5ab
Co-authored-by: gambletan <[email protected]>
Co-authored-by: altaywtf <[email protected]>
Reviewed-by: @altaywtf
jenawant pushed a commit to jenawant/openclaw that referenced this pull request Mar 10, 2026
openclaw#39374)

Merged via squash.

Prepared head SHA: 0eba5ab
Co-authored-by: gambletan <[email protected]>
Co-authored-by: altaywtf <[email protected]>
Reviewed-by: @altaywtf
sauerdaniel pushed a commit to sauerdaniel/openclaw that referenced this pull request Mar 11, 2026
openclaw#39374)

Merged via squash.

Prepared head SHA: 0eba5ab
Co-authored-by: gambletan <[email protected]>
Co-authored-by: altaywtf <[email protected]>
Reviewed-by: @altaywtf
dhoman pushed a commit to dhoman/chrono-claw that referenced this pull request Mar 11, 2026
openclaw#39374)

Merged via squash.

Prepared head SHA: 0eba5ab
Co-authored-by: gambletan <[email protected]>
Co-authored-by: altaywtf <[email protected]>
Reviewed-by: @altaywtf
alexey-pelykh pushed a commit to remoteclaw/remoteclaw that referenced this pull request Mar 14, 2026
openclaw#39374)

Merged via squash.

Prepared head SHA: 0eba5ab
Co-authored-by: gambletan <[email protected]>
Co-authored-by: altaywtf <[email protected]>
Reviewed-by: @altaywtf

(cherry picked from commit e5fdfec)
alexey-pelykh added a commit to remoteclaw/remoteclaw that referenced this pull request Mar 14, 2026
…ile driver in Zod schema (#1292)

* fix(config): accept "openclaw" as browser profile driver in Zod schema (openclaw#39374)

Merged via squash.

Prepared head SHA: 0eba5ab
Co-authored-by: gambletan <[email protected]>
Co-authored-by: altaywtf <[email protected]>
Reviewed-by: @altaywtf

(cherry picked from commit e5fdfec)

* fix: update test expectations for rebranded browser driver enum

The upstream cherry-pick added "openclaw" as a driver option, which the fork
rebrand converted to "remoteclaw". The test expectations auto-merged with
stale "openclaw" literal — update to match the rebranded enum value.

---------

Co-authored-by: gambletan <[email protected]>
senw-developers pushed a commit to senw-developers/va-openclaw that referenced this pull request Mar 17, 2026
openclaw#39374)

Merged via squash.

Prepared head SHA: 0eba5ab
Co-authored-by: gambletan <[email protected]>
Co-authored-by: altaywtf <[email protected]>
Reviewed-by: @altaywtf
V-Gutierrez pushed a commit to V-Gutierrez/openclaw-vendor that referenced this pull request Mar 17, 2026
openclaw#39374)

Merged via squash.

Prepared head SHA: 0eba5ab
Co-authored-by: gambletan <[email protected]>
Co-authored-by: altaywtf <[email protected]>
Reviewed-by: @altaywtf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Browser profile driver "openclaw" rejected by Zod schema (only accepts legacy "clawd")

3 participants