-
-
Notifications
You must be signed in to change notification settings - Fork 69.7k
OpenRouter models missing from static snapshot silently drop images #45867
Description
Symptom
Using openrouter/healer-alpha (a vision-capable model), sending an image
via Feishu/tool results — the model says "the image is too dark" or "can't see the content"
because it literally never received the image data.
Root cause
When an OpenRouter model is not in the static snapshot
(models.generated.ts), resolveModelWithRegistry falls back to
input: ["text"]. This causes two independent filters to drop images:
detectAndLoadPromptImageschecksmodel.input.includes("image")
→ returns empty, no image loaded into user messageopenai-completions.jsconvertMessageschecks
model.input.includes("image")→ strips image blocks from tool results
Both are silent — no error, no warning. The model receives
"Read image file [image/jpeg]" as plain text with no actual image data.
Evidence
Captured the actual API request sent to OpenRouter for the same image,
same query:
With fallback input: ["text"] (current behavior):
{"role":"tool","content":"Read image file [image/jpeg]","tool_call_id":"2e8b1f235"}
// No user message with image_url follows — images silently droppedWith correct input: ["text","image"]:
{"role":"tool","content":"Read image file [image/jpeg]","tool_call_id":"call091c1c3ac38a4c6997ed9998"},
{"role":"user","content":[
{"type":"text","text":"Attached image(s) from tool result:"},
{"type":"image_url","image_url":{"url":"data:image/jpeg;base64,..."}}
]}Why this keeps happening
The built-in model list is a static snapshot baked at build time:
- OpenRouter adds a new model
- Someone manually runs
npm run generate-modelsin pi-mono - pi-ai publishes to npm
- openclaw updates the dependency and releases
- User updates openclaw
No step is automated. Until the full chain completes, every new model
is silently broken for vision use.
Proposed fix
OpenRouter provides a public API (/api/v1/models) that returns model
capabilities in real time — ~465KB, under a second, no auth required.
A lightweight runtime lookup with disk + in-memory caching eliminates this
entire dependency chain at minimal cost.
See #45824 for implementation — tested end-to-end with healer-alpha
successfully receiving and describing images after the fix.