openclaw - ✅(Solved) Fix v2026.3.24: image_generate tool fails - providers not registered [1 pull requests, 1 comments, 2 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#55011Fetched 2026-04-08 01:33:44
View on GitHub
Comments
1
Participants
2
Timeline
1
Reactions
0
Author
Participants
Timeline (top)
commented ×1

The image_generate tool fails in v2026.3.24 even when image generation providers (OpenAI, Anthropic) are properly configured and enabled as plugins.

Error Message

All image generation models failed (3): 
  anthropic/claude-opus-4-6: No image-generation provider registered for anthropic 
  openrouter/openai/dall-e-3: No image-generation provider registered for openrouter 
  openrouter/black-forest-labs/flux-pro: No image-generation provider registered for openrouter

Root Cause

The image_generate tool in v2026.3.24 was refactored away from the bundled nano-banana-pro skill. However, the provider registration for image generation capabilities is broken:

  1. Plugins are loaded correctly (discord, brave, openai, anthropic all enabled)
  2. imageGenerationModel is properly configured
  3. But provider registration layer is not wiring up image-generation capability

Suspected fix areas:

  • Provider plugin initialization
  • Image generation capability gate
  • Model catalog resolution for image providers

Fix Action

Workaround

External workaround via shell script calling OpenRouter API directly + manual Discord posting.

PR fix notes

PR #67668: feat(openrouter): add image generation provider

Description (problem / solution / changelog)

Summary

  • Adds image generation support to the OpenRouter extension via the OpenAI-compatible /chat/completions endpoint (modalities: ["image", "text"])
  • Implements a native image generation provider following existing provider patterns (OpenAI, Google, fal, minimax, vydra)
  • Supports generate + edit modes, multiple aspect ratios (1:1 through 21:9), and resolution hints (1K/2K/4K) via image_config
  • Handles OpenRouter's non-standard image response format (message.images[].image_url.url) with robust fallbacks for other response structures
  • Ships with Gemini image models as defaults; the provider is model-agnostic and supports any image-capable model routed through OpenRouter
  • Production-tested end-to-end on a live OpenClaw instance (running in docker, hosted on ClawBob)

Change Type

  • Bug fix
  • Feature
  • Refactor required for the fix
  • Docs
  • Security hardening
  • Chore/infra

Scope

  • Gateway / orchestration
  • Skills / tool execution
  • Auth / tokens
  • Memory / storage
  • Integrations
  • API / contracts
  • UI / DX
  • CI/CD / infra

Root Cause

  • OpenRouter does not expose image generation as a native provider in OpenClaw, despite supporting image outputs via its chat completions API
  • Its response format differs from other providers (images returned outside message.content), requiring custom parsing logic

User-visible / Behavior Changes

  • Users can now generate and edit images using OpenRouter-backed models through the image_generate tool
  • OpenRouter becomes a first-class image generation provider alongside existing native providers
  • No additional provider keys required if OpenRouter is already configured

Issues

Resolves: #55066, #50485, #55277, #55011

Repro + Verification

Environment

  • OS: Linux (Dockerized OpenClaw instance)
  • Runtime/container: OpenClaw (Coolify deployment)
  • Model/provider: openrouter/google/gemini-3-pro-image-preview
  • Integration/channel (if any): OpenRouter extension

Verified

  • Contract: plugin registers imageGenerationProviderIds and satisfies requireGenerateImage
  • Live: image-generation.runtime.live.test.ts passes for OpenRouter (generate + edit)
  • Manual: confirmed image_generate tool produces valid images with correct formats and configurations

Build Note

  • No new build issues introduced
  • Uses existing SDK HTTP helpers (postJsonRequest, assertOkOrThrowHttpError) consistent with other providers

Changed files

  • extensions/openrouter/api.ts (modified, +1/-0)
  • extensions/openrouter/image-generation-provider.ts (added, +269/-0)
  • extensions/openrouter/index.ts (modified, +2/-0)
  • extensions/openrouter/openclaw.plugin.json (modified, +2/-1)
  • extensions/openrouter/test-api.ts (modified, +1/-0)
  • src/image-generation/live-test-helpers.ts (modified, +1/-0)
  • test/helpers/plugins/plugin-registration-contract-cases.ts (modified, +2/-0)
  • test/image-generation.runtime.live.test.ts (modified, +5/-0)

Code Example

All image generation models failed (3): 
  anthropic/claude-opus-4-6: No image-generation provider registered for anthropic 
  openrouter/openai/dall-e-3: No image-generation provider registered for openrouter 
  openrouter/black-forest-labs/flux-pro: No image-generation provider registered for openrouter

---

"imageGenerationModel": {
    "primary": "openrouter/openai/dall-e-3",
    "fallbacks": [
      "openrouter/black-forest-labs/flux-pro",
      "anthropic/claude-opus-4-6"
    ]
  }
RAW_BUFFERClick to expand / collapse

Bug Report

Description

The image_generate tool fails in v2026.3.24 even when image generation providers (OpenAI, Anthropic) are properly configured and enabled as plugins.

Error Message

All image generation models failed (3): 
  anthropic/claude-opus-4-6: No image-generation provider registered for anthropic 
  openrouter/openai/dall-e-3: No image-generation provider registered for openrouter 
  openrouter/black-forest-labs/flux-pro: No image-generation provider registered for openrouter

Environment

  • OpenClaw Version: v2026.3.24
  • OS: Linux
  • Configuration: OpenAI + Anthropic + OpenRouter plugins enabled
  • Image generation model config:
    "imageGenerationModel": {
      "primary": "openrouter/openai/dall-e-3",
      "fallbacks": [
        "openrouter/black-forest-labs/flux-pro",
        "anthropic/claude-opus-4-6"
      ]
    }

Steps to Reproduce

  1. Update to v2026.3.24
  2. Configure image generation models (any provider)
  3. Enable image generation plugins in config
  4. Call image_generate(prompt="test")

Expected Behavior

  • Image should be generated via the configured provider
  • Image URL returned and posted to Discord (with attachment)

Actual Behavior

  • Tool fails with "No image-generation provider registered" error
  • No provider is being recognized despite being enabled

Root Cause Analysis

The image_generate tool in v2026.3.24 was refactored away from the bundled nano-banana-pro skill. However, the provider registration for image generation capabilities is broken:

  1. Plugins are loaded correctly (discord, brave, openai, anthropic all enabled)
  2. imageGenerationModel is properly configured
  3. But provider registration layer is not wiring up image-generation capability

Suspected fix areas:

  • Provider plugin initialization
  • Image generation capability gate
  • Model catalog resolution for image providers

Secondary Issue: Discord Integration

Even when image generation works, Discord reply formatting doesn't automatically attach the generated image as a file. Images are returned as URLs in text instead of being downloaded and posted as Discord attachments.

Workaround

External workaround via shell script calling OpenRouter API directly + manual Discord posting.

Related

  • Migration from nano-banana-pro to core tool (v2026.3.22+)
  • Affects all users on v2026.3.24 trying to use image_generate

Priority

🔴 High - Blocks image generation feature for all providers

extent analysis

Fix Plan

To resolve the issue, we need to update the provider registration for image generation capabilities. Here are the steps:

  • Update the imageGenerationModel configuration to include the provider type:
    "imageGenerationModel": {
      "primary": {
        "provider": "openai",
        "model": "openrouter/openai/dall-e-3"
      },
      "fallbacks": [
        {
          "provider": "openrouter",
          "model": "openrouter/black-forest-labs/flux-pro"
        },
        {
          "provider": "anthropic",
          "model": "anthropic/claude-opus-4-6"
        }
      ]
    }
  • Modify the image_generate tool to register the image generation providers:
    # Register image generation providers
    from openclaw.plugins import register_provider
    
    register_provider("openai", OpenAIImageProvider)
    register_provider("openrouter", OpenRouterImageProvider)
    register_provider("anthropic", AnthropicImageProvider)
  • Update the image_generate function to use the registered providers:
    # image_generate function
    def image_generate(prompt):
      # Get the primary provider
      primary_provider = get_provider("openai")
    
      # Generate the image using the primary provider
      image_url = primary_provider.generate_image(prompt)
    
      # If primary provider fails, use fallbacks
      if not image_url:
        for fallback in get_fallback_providers():
          image_url = fallback.generate_image(prompt)
          if image_url:
            break
    
      # Post the image to Discord
      post_image_to_discord(image_url)
  • To fix the Discord integration issue, update the post_image_to_discord function to download the image and post it as an attachment:
    # post_image_to_discord function
    def post_image_to_discord(image_url):
      # Download the image
      image_data = requests.get(image_url).content
    
      # Post the image to Discord
      discord_channel.send(file=discord.File(image_data, "image.png"))

Verification

To verify that the fix worked, call the image_generate function with a test prompt and check that the image is generated and posted to Discord correctly.

Extra Tips

  • Make sure to update the openclaw.plugins module to include the new provider registration code.
  • Test the image_generate function with different providers and fallbacks to ensure that it works correctly.
  • Consider adding error handling and logging to the image_generate function to handle cases where the image generation fails.

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…

Still need to ship something?

×6

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

Back to top recommendations

TRENDING