Skip to content

[Bug]: Image Generation Failed: No image-generation provider registered for google / openai even imageGenerationModel and providers are configured. Regression version 2026.3.23 #53450

Description

@fangli

Summary

image_generate can fail with No image-generation provider registered for google even when the Google plugin is loaded and configured.

Repro

In a runtime where the active plugin registry has a cache key but no imageGenerationProviders, image generation provider lookup skips plugin reload and returns an empty provider list.

Observed symptoms in a live OpenClaw install:

  • openclaw plugins list showed google loaded with image-generation capability
  • launchd environment contained GEMINI_API_KEY / GOOGLE_API_KEY
  • openclaw models status showed Google auth as configured
  • image_generate still failed with:
    • No image-generation provider registered for google
    • similarly for openai / fal

Root cause

src/image-generation/provider-registry.ts currently does this:

const registry =
  (active?.imageGenerationProviders?.length ?? 0) > 0 || getActivePluginRegistryKey() || !cfg
    ? active
    : loadOpenClawPlugins({ config: cfg });

That getActivePluginRegistryKey() condition is too aggressive. If an active registry exists with a key but no image providers, lookup will not fall back to loadOpenClawPlugins({ config: cfg }), so the provider map stays empty.

Expected behavior

If the active registry has no image-generation providers and a config is available, provider lookup should fall back to loading plugins from config.

Proposed fix

Remove the getActivePluginRegistryKey() shortcut from image-generation provider resolution and add a regression test covering:

  • active registry present
  • cache key present
  • imageGenerationProviders = []
  • config provided
  • provider lookup falls back to loadOpenClawPlugins(...)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions