Bug
Running openclaw doctor --fix fails with:
Error: Config validation failed: models.providers.google.baseUrl: Invalid input: expected string, received undefined
Reproduction
- Have a legacy
skills.entries.nano-banana-pro config with an apiKey (but no existing models.providers.google section)
- Run
openclaw doctor --fix
- The migration moves the API key to
models.providers.google.apiKey but does not populate the required baseUrl or models fields
- 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
Bug
Running
openclaw doctor --fixfails with:Reproduction
skills.entries.nano-banana-proconfig with anapiKey(but no existingmodels.providers.googlesection)openclaw doctor --fixmodels.providers.google.apiKeybut does not populate the requiredbaseUrlormodelsfieldsModelProviderSchemarequiresbaseUrl: z.string().min(1)andmodels: z.array(...))Root Cause
In
src/commands/doctor-legacy-config.ts, the nano-banana migration creates a partialmodels.providers.google = { apiKey: "..." }object when no pre-existing google provider config exists. TheModelProviderSchemarequiresbaseUrlandmodelsbut the migration only setsapiKey.Expected
doctor --fixshould successfully migrate the legacy nano-banana config without crashing.Workaround
Manually set the required fields before running doctor: