openclaw - 💡(How to fix) Fix [Bug]: doctor --fix nano-banana migration creates invalid models.providers.google (missing baseUrl and models) [2 comments, 3 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#52814Fetched 2026-04-08 01:18:57
View on GitHub
Comments
2
Participants
3
Timeline
7
Reactions
3
Author
Timeline (top)
subscribed ×4commented ×2cross-referenced ×1

openclaw doctor --fix crashes with Config validation failed: models.providers.google.baseUrl: Invalid input: expected string, received undefined when migrating legacy skills.entries.nano-banana-pro config to models.providers.google.

Error Message

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

Root Cause

Root cause: src/commands/doctor-legacy-config.ts in normalizeLegacyNanoBananaSkill (around line 574) creates rawGoogle = {} for a new provider, sets only apiKey, then passes it to config write. The ModelProviderSchema in src/config/zod-schema.core.ts requires baseUrl: z.string().min(1) and models: z.array(ModelDefinitionSchema).

Code Example

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

---

Doctor changes ───────────────────────────────────────────────────────────────────────╮
│                                                                                        │
Moved skills.entries.nano-banana-pro → agents.defaults.imageGenerationModel.primary  (google/gemini-3-pro-image-preview).                                                  
Moved skills.entries.nano-banana-pro.apiKey → models.providers.google.apiKey.          
Removed legacy skills.entries.nano-banana-pro.                                        
│                                                                                        │
├────────────────────────────────────────────────────────────────────────────────────────╯

Error: Config validation failed: models.providers.google.baseUrl: Invalid input: expected string, received undefined
 ELIFECYCLE  Command failed with exit code 1.
RAW_BUFFERClick to expand / collapse

Bug type

Behavior bug (incorrect output/state without crash)

Summary

openclaw doctor --fix crashes with Config validation failed: models.providers.google.baseUrl: Invalid input: expected string, received undefined when migrating legacy skills.entries.nano-banana-pro config to models.providers.google.

Steps to reproduce

  1. Have a config with a legacy skills.entries.nano-banana-pro entry containing an apiKey (and no pre-existing models.providers.google).
  2. Run openclaw doctor --fix.
  3. The migration creates models.providers.google with only apiKey, missing the required baseUrl and models fields.
  4. The subsequent writeConfigFile call runs Zod validation via ModelProviderSchema, which requires baseUrl: z.string().min(1) and models: z.array(...).
  5. Validation fails and the process exits with code 1.

Expected behavior

doctor --fix should successfully migrate the nano-banana-pro skill config to models.providers.google with all required schema fields populated, then write the config without errors.

Actual behavior

The migration in normalizeCompatibilityConfigValues (src/commands/doctor-legacy-config.ts) creates a partial models.providers.google entry containing only apiKey. The config write fails with:

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

The config file is not updated (the write is atomic), so the legacy skill entry remains and the error recurs on every subsequent doctor --fix run.

OpenClaw version

2026.3.23 (4f92eaa)

Operating system

macOS 15.4

Install method

pnpm dev

Model

N/A (config migration, not model-specific)

Provider / routing chain

N/A

Logs, screenshots, and evidence

◇  Doctor changes ───────────────────────────────────────────────────────────────────────╮
│                                                                                        │
│  Moved skills.entries.nano-banana-pro → agents.defaults.imageGenerationModel.primary   │
│  (google/gemini-3-pro-image-preview).                                                  │
│  Moved skills.entries.nano-banana-pro.apiKey → models.providers.google.apiKey.          │
│  Removed legacy skills.entries.nano-banana-pro.                                        │
│                                                                                        │
├────────────────────────────────────────────────────────────────────────────────────────╯

Error: Config validation failed: models.providers.google.baseUrl: Invalid input: expected string, received undefined
 ELIFECYCLE  Command failed with exit code 1.

Impact and severity

Affected: Any user with a legacy nano-banana-pro skill entry and no pre-existing models.providers.google config. Severity: Medium (blocks doctor --fix completion; gateway startup also fails if the migration is applied via other code paths). Frequency: Always reproducible when conditions are met. Consequence: Legacy skill config is never migrated; doctor --fix must be re-run after a code fix.

Additional information

Root cause: src/commands/doctor-legacy-config.ts in normalizeLegacyNanoBananaSkill (around line 574) creates rawGoogle = {} for a new provider, sets only apiKey, then passes it to config write. The ModelProviderSchema in src/config/zod-schema.core.ts requires baseUrl: z.string().min(1) and models: z.array(ModelDefinitionSchema).

Fix: When creating a new google provider entry (not merging into an existing one), populate the required fields with sensible defaults:

  • baseUrl: "https://generativelanguage.googleapis.com"
  • models: []

extent analysis

Fix Plan

To fix the issue, we need to modify the normalizeLegacyNanoBananaSkill function in src/commands/doctor-legacy-config.ts to populate the required fields with sensible defaults when creating a new Google provider entry.

Here are the steps:

  • Open src/commands/doctor-legacy-config.ts and navigate to the normalizeLegacyNanoBananaSkill function.
  • Modify the rawGoogle object creation to include the required fields with default values:
const rawGoogle = {
  apiKey: legacySkill.apiKey,
  baseUrl: 'https://generativelanguage.googleapis.com',
  models: [],
};
  • Save the changes and re-run the openclaw doctor --fix command.

Verification

To verify that the fix worked, check the following:

  • The openclaw doctor --fix command completes successfully without errors.
  • The models.providers.google entry in the config file is populated with the required fields, including baseUrl and models.
  • The legacy skills.entries.nano-banana-pro entry is removed from the config file.

Extra Tips

  • Make sure to test the fix with different scenarios, including existing models.providers.google entries and various legacy skill configurations.
  • Consider adding additional validation or logging to ensure that the fix is working as expected and to catch any potential issues.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

doctor --fix should successfully migrate the nano-banana-pro skill config to models.providers.google with all required schema fields populated, then write the config without errors.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING