Summary
OpenClaw has systemic issues with image/vision handling across multiple channels (Discord, Telegram, OpenWebUI). Images sent by users are not properly forwarded to vision-capable models, causing models to hallucinate or respond as if no image was provided. This affects both primary vision models and imageModel fallback configurations.
Related Issues
Problem Description
Current Behavior
When users send images to OpenClaw through various channels:
-
Discord: Images are not passed to vision models. Models hallucinate descriptions or claim they cannot see images.
-
Telegram: Images are received by gateway but not passed to configured imageModel. Text model responds instead.
-
OpenWebUI (via /v1/chat/completions): Image parts are dropped before reaching the agent. Only text content is processed.
-
Caching Issues: Discord attachments sometimes return stale/cached content instead of fresh uploads.
Expected Behavior
Per OpenClaw Documentation:
agents.defaults.imageModel is used only when the primary model can't accept images.
The expected flow:
- User sends image attachment
- Gateway detects image and extracts media
- If primary model supports vision (
input: ["text", "image"]), forward image to primary model
- If primary model doesn't support vision, use configured
imageModel
- Model receives actual image data (not just text placeholders)
- Model responds with accurate image description
Actual Flow (Broken)
User sends image → Gateway receives → [BROKEN] → Model receives text placeholder only
↓
Image not forwarded to:
- Primary vision model, OR
- Configured imageModel
Evidence
Issue #7564 (Telegram)
User configured:
- Primary:
ollama/qwen3-coder:latest (text-only)
- imageModel:
ollama/qwen2.5vl:7b (vision)
Result: Text model responds "I'm receiving images but cannot see them"
Logs show: No media, photo, image, or imageModel references
Direct API test to Ollama with base64 image: Works correctly (450+ prompt tokens)
Issue #6410 (Discord)
User sends image with "describe this image"
Model: Claude Opus 4.5 via LiteLLM
Result: Model hallucinates/fabricates description
Issue #18583 (OpenWebUI)
Code analysis reveals:
extractTextContent() in src/gateway/openai-http.ts only keeps text parts
- Image parts are not parsed or forwarded to
agentCommand()
/v1/responses endpoint handles images correctly (proven working path)
/v1/chat/completions drops image inputs
Root Cause Analysis
Based on code review and issue analysis:
-
Incomplete Image Parsing:
- OpenAI-compatible endpoint doesn't parse
image_url content parts
- Only text content is extracted and forwarded
-
Broken Model Routing:
imageModel configuration ignored when primary model claims vision support
- Primary model may claim
input: ["text", "image"] but not actually receive image data
-
Channel-Specific Issues:
- Discord: Attachment caching/download issues
- Telegram: Media not passed to image processing pipeline
-
Missing Integration:
- Media attachments converted to text placeholders:
[Image: source: /path/to/image.jpg]
- Actual image bytes not forwarded to models
Impact
- Severity: High
- Frequency: 100% reproducible in affected configurations
- User Experience: Vision/multimodal capabilities completely broken
- Workaround Complexity: High - requires manual intervention
Workarounds (Current)
-
Manual image tool call:
image({ image: "/path/to/local/image.jpg", prompt: "Describe this image" })
-
Use /v1/responses endpoint (for API users) - confirmed working
-
Avoid vision workflows - use text-only interactions
Proposed Solutions
Short-term
-
Fix /v1/chat/completions image handling:
- Parse
image_url content parts (URL and data-URI/base64)
- Validate via existing media helpers
- Forward to
agentCommand() for both stream and non-stream paths
- Raise default max body size (currently 1MB too small for base64 images)
-
Fix Discord image ingestion:
- Resolve attachment caching issues
- Ensure fresh downloads for each upload
-
Fix Telegram imageModel routing:
- Ensure images are passed to configured
imageModel
- Add logging for media detection and routing decisions
Long-term
- Unified image handling: Align all endpoints and channels to use same image processing pipeline
- Better model capability detection: Actually verify vision models receive and can process images
- Comprehensive testing: Add integration tests for vision workflows across all channels
Environment
- OpenClaw versions: 2026.1.24 through 2026.2.14
- Affected channels: Discord, Telegram, OpenWebUI
- Affected providers: Ollama, LiteLLM, OpenRouter, and others
- OS: Linux, Windows, macOS
Additional Context
The /v1/responses endpoint demonstrates that OpenClaw can handle images correctly. The issue is that this functionality hasn't been extended to:
- Discord/Telegram channel handlers
/v1/chat/completions endpoint
- Proper
imageModel fallback routing
This suggests the fix is primarily about connecting existing working components rather than building new functionality from scratch.
Summary
OpenClaw has systemic issues with image/vision handling across multiple channels (Discord, Telegram, OpenWebUI). Images sent by users are not properly forwarded to vision-capable models, causing models to hallucinate or respond as if no image was provided. This affects both primary vision models and
imageModelfallback configurations.Related Issues
imagetool ignoresagents.defaults.modelsparameter overrides (maxTokens), resulting in "Image model returned no text" error #8096 - image tool ignores model parameter overridesProblem Description
Current Behavior
When users send images to OpenClaw through various channels:
Discord: Images are not passed to vision models. Models hallucinate descriptions or claim they cannot see images.
Telegram: Images are received by gateway but not passed to configured
imageModel. Text model responds instead.OpenWebUI (via /v1/chat/completions): Image parts are dropped before reaching the agent. Only text content is processed.
Caching Issues: Discord attachments sometimes return stale/cached content instead of fresh uploads.
Expected Behavior
Per OpenClaw Documentation:
The expected flow:
input: ["text", "image"]), forward image to primary modelimageModelActual Flow (Broken)
Evidence
Issue #7564 (Telegram)
User configured:
ollama/qwen3-coder:latest(text-only)ollama/qwen2.5vl:7b(vision)Result: Text model responds "I'm receiving images but cannot see them"
Logs show: No media, photo, image, or imageModel references
Direct API test to Ollama with base64 image: Works correctly (450+ prompt tokens)
Issue #6410 (Discord)
User sends image with "describe this image"
Model: Claude Opus 4.5 via LiteLLM
Result: Model hallucinates/fabricates description
Issue #18583 (OpenWebUI)
Code analysis reveals:
extractTextContent()insrc/gateway/openai-http.tsonly keeps text partsagentCommand()/v1/responsesendpoint handles images correctly (proven working path)/v1/chat/completionsdrops image inputsRoot Cause Analysis
Based on code review and issue analysis:
Incomplete Image Parsing:
image_urlcontent partsBroken Model Routing:
imageModelconfiguration ignored when primary model claims vision supportinput: ["text", "image"]but not actually receive image dataChannel-Specific Issues:
Missing Integration:
[Image: source: /path/to/image.jpg]Impact
Workarounds (Current)
Manual
imagetool call:Use
/v1/responsesendpoint (for API users) - confirmed workingAvoid vision workflows - use text-only interactions
Proposed Solutions
Short-term
Fix
/v1/chat/completionsimage handling:image_urlcontent parts (URL and data-URI/base64)agentCommand()for both stream and non-stream pathsFix Discord image ingestion:
Fix Telegram imageModel routing:
imageModelLong-term
Environment
Additional Context
The
/v1/responsesendpoint demonstrates that OpenClaw can handle images correctly. The issue is that this functionality hasn't been extended to:/v1/chat/completionsendpointimageModelfallback routingThis suggests the fix is primarily about connecting existing working components rather than building new functionality from scratch.