Skip to content

doctor --fix crashes with Config validation failed on models.providers.google.baseUrl #53756

@mahopan

Description

@mahopan

Bug

Running openclaw doctor --fix fails with:

Error: Config validation failed: models.providers.google.baseUrl: Invalid input: expected string, received undefined

Reproduction

  1. Have a legacy skills.entries.nano-banana-pro config with an apiKey (but no existing models.providers.google section)
  2. Run openclaw doctor --fix
  3. The migration moves the API key to models.providers.google.apiKey but does not populate the required baseUrl or models fields
  4. Config write fails Zod validation (ModelProviderSchema requires baseUrl: z.string().min(1) and models: z.array(...))

Root Cause

In src/commands/doctor-legacy-config.ts, the nano-banana migration creates a partial models.providers.google = { apiKey: "..." } object when no pre-existing google provider config exists. The ModelProviderSchema requires baseUrl and models but the migration only sets apiKey.

Expected

doctor --fix should successfully migrate the legacy nano-banana config without crashing.

Workaround

Manually set the required fields before running doctor:

openclaw config set models.providers.google.baseUrl "https://generativelanguage.googleapis.com"
openclaw config set models.providers.google.models "[]"
openclaw doctor --fix

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions