openclaw - 💡(How to fix) Fix [Bug]: Image tool ignores user-configured provider baseUrl for zai/glm-5v-turbo, routes to vercel-ai-gateway instead (404) [1 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#70604Fetched 2026-04-24 05:55:51
View on GitHub
Comments
0
Participants
1
Timeline
0
Reactions
0
Author
Participants

The image tool always routes zai/glm-5v-turbo through pi-ai's built-in model registry entry (vercel-ai-gateway + anthropic-messages API) instead of the user-configured zai provider (open.bigmodel.cn/api/coding/paas/v4 + openai-completions), resulting in a 404 "Not Found" error on every image analysis call.

Error Message

Image tool call

image(model="zai/glm-5v-turbo", image="/path/to/screenshot.png", prompt="Describe this page") < Error: Image model failed (zai/glm-5v-turbo): 404 "Not Found"

Direct curl to user-configured endpoint (same key, same model, same image) — works

curl -s -w "HTTP:%{http_code}" -X POST "https://open.bigmodel.cn/api/coding/paas/v4/chat/completions"
-H "Authorization: Bearer <REDACTED>"
-H "Content-Type: application/json"
-d '{"model":"glm-5v-turbo","messages":[{"role":"user","content":[{"type":"text","text":"describe"},{"type":"image_url","image_url":{"url":"data:image/png;base64,..."}}]}]}' < {"choices":[{"message":{"content":"..."}}]...} HTTP:200

Built-in registry entry in pi-ai models.generated.js (source of the bug)

"zai/glm-5v-turbo": { id: "zai/glm-5v-turbo", name: "GLM 5V Turbo", api: "anthropic-messages", provider: "vercel-ai-gateway", baseUrl: "https://ai-gateway.vercel.sh" }

Root Cause

Note: Sending images via Feishu channel works correctly because the Feishu message pipeline uses the session model directly (which respects user provider config), bypassing the image tool path entirely.

Fix Action

Fix / Workaround

Additional information

Workaround: Use a subagent with a different provider's vision model (e.g., google-gemini-cli/gemini-3-flash-preview) for image analysis tasks.

Code Example

"zai/glm-5v-turbo": {
       id: "zai/glm-5v-turbo",
       name: "GLM 5V Turbo",
       api: "anthropic-messages",
       provider: "vercel-ai-gateway",
       baseUrl: "https://ai-gateway.vercel.sh"
   }

---

# Image tool call
> image(model="zai/glm-5v-turbo", image="/path/to/screenshot.png", prompt="Describe this page")
< Error: Image model failed (zai/glm-5v-turbo): 404 "Not Found"

# Direct curl to user-configured endpoint (same key, same model, same image) — works
> curl -s -w "HTTP:%{http_code}" -X POST "https://open.bigmodel.cn/api/coding/paas/v4/chat/completions" \
  -H "Authorization: Bearer <REDACTED>" \
  -H "Content-Type: application/json" \
  -d '{"model":"glm-5v-turbo","messages":[{"role":"user","content":[{"type":"text","text":"describe"},{"type":"image_url","image_url":{"url":"data:image/png;base64,..."}}]}]}'
< {"choices":[{"message":{"content":"..."}}]...} HTTP:200

# Built-in registry entry in pi-ai models.generated.js (source of the bug)
"zai/glm-5v-turbo": {
    id: "zai/glm-5v-turbo",
    name: "GLM 5V Turbo",
    api: "anthropic-messages",
    provider: "vercel-ai-gateway",
    baseUrl: "https://ai-gateway.vercel.sh"
}
RAW_BUFFERClick to expand / collapse

Bug type

Behavior bug (incorrect output/state without crash)

Beta release blocker

No

Summary

The image tool always routes zai/glm-5v-turbo through pi-ai's built-in model registry entry (vercel-ai-gateway + anthropic-messages API) instead of the user-configured zai provider (open.bigmodel.cn/api/coding/paas/v4 + openai-completions), resulting in a 404 "Not Found" error on every image analysis call.

Steps to reproduce

  1. Configure zai provider in openclaw.json with baseUrl: "https://open.bigmodel.cn/api/coding/paas/v4", api: "openai-completions", and a model entry for glm-5v-turbo with "input": ["text", "image"].
  2. Optionally add "agents.defaults.imageModel": { "primary": "zai/glm-5v-turbo" }.
  3. Call the image tool with any local image file and model: "zai/glm-5v-turbo".
  4. Observe Image model failed (zai/glm-5v-turbo): 404 "Not Found".

Expected behavior

The image tool should use the user-configured zai provider settings (baseUrl, api, apiKey) from openclaw.json to call glm-5v-turbo for image analysis. The same endpoint + model + key pair works correctly when called directly via curl with OpenAI vision-format messages (confirmed 200 OK with valid image description response).

Actual behavior

The image tool returns 404 "Not Found". Source code tracing reveals:

  1. image-DR5h04LW.jsresolveImageRuntime() calls modelRegistry.find("zai", "glm-5v-turbo") from pi-ai.
  2. pi-ai's models.generated.js has a built-in entry for zai/glm-5v-turbo with:
    "zai/glm-5v-turbo": {
        id: "zai/glm-5v-turbo",
        name: "GLM 5V Turbo",
        api: "anthropic-messages",
        provider: "vercel-ai-gateway",
        baseUrl: "https://ai-gateway.vercel.sh"
    }
  3. This built-in entry takes precedence over the user's openclaw.json model configuration. The request goes to https://ai-gateway.vercel.sh using anthropic-messages API format, which returns 404.

Adding api/baseUrl fields to the model entry in openclaw.json does NOT override the built-in registry values.

Note: Sending images via Feishu channel works correctly because the Feishu message pipeline uses the session model directly (which respects user provider config), bypassing the image tool path entirely.

OpenClaw version

2026.4.21 (f788c88)

Operating system

Ubuntu (Linux 6.17.0-20-generic x64)

Install method

npm global

Model

zai/glm-5v-turbo

Provider / routing chain

  • Image tool path: openclaw → pi-ai model registry → vercel-ai-gateway (https://ai-gateway.vercel.sh) → 404
  • Expected path: openclaw → user-configured zai provider → https://open.bigmodel.cn/api/coding/paas/v4 → 200 OK

Additional provider/model setup details

  • Default agent model: zai/glm-5v-turbo (works for chat, fails for image tool only)
  • zai provider in openclaw.json: baseUrl: "https://open.bigmodel.cn/api/coding/paas/v4", api: "openai-completions"
  • Model entry includes "input": ["text", "image"]
  • Also tried setting agents.defaults.imageModel.primary: "zai/glm-5v-turbo" — no effect
  • Also tried adding api/baseUrl override fields directly on the model entry in openclaw.json — no effect
  • Direct curl to https://open.bigmodel.cn/api/coding/paas/v4/chat/completions with OpenAI vision-format payload returns 200 OK with correct image description

Logs, screenshots, and evidence

# Image tool call
> image(model="zai/glm-5v-turbo", image="/path/to/screenshot.png", prompt="Describe this page")
< Error: Image model failed (zai/glm-5v-turbo): 404 "Not Found"

# Direct curl to user-configured endpoint (same key, same model, same image) — works
> curl -s -w "HTTP:%{http_code}" -X POST "https://open.bigmodel.cn/api/coding/paas/v4/chat/completions" \
  -H "Authorization: Bearer <REDACTED>" \
  -H "Content-Type: application/json" \
  -d '{"model":"glm-5v-turbo","messages":[{"role":"user","content":[{"type":"text","text":"describe"},{"type":"image_url","image_url":{"url":"data:image/png;base64,..."}}]}]}'
< {"choices":[{"message":{"content":"..."}}]...} HTTP:200

# Built-in registry entry in pi-ai models.generated.js (source of the bug)
"zai/glm-5v-turbo": {
    id: "zai/glm-5v-turbo",
    name: "GLM 5V Turbo",
    api: "anthropic-messages",
    provider: "vercel-ai-gateway",
    baseUrl: "https://ai-gateway.vercel.sh"
}

Impact and severity

  • Affected: All users who configured zai/glm-5v-turbo as their image model via openclaw.json and expect it to use their own zai API credentials and endpoint.
  • Severity: High — image tool is completely non-functional for this model, blocking all image analysis workflows.
  • Frequency: Always (100% reproducible, 4/4 attempts).
  • Consequence: Cannot use glm-5v-turbo for image analysis; must fall back to other providers (e.g., Gemini via subagent).

Additional information

Workaround: Use a subagent with a different provider's vision model (e.g., google-gemini-cli/gemini-3-flash-preview) for image analysis tasks.

Root cause: pi-ai's models.generated.js built-in registry takes precedence over user openclaw.json model configuration for provider/api/baseUrl resolution. The resolveImageRuntime() function in image-DR5h04LW.js calls modelRegistry.find() which returns the built-in entry, and the user config is ignored for routing decisions.

Suggested fix: When a user explicitly configures a provider with baseUrl and api in openclaw.json, the image tool runtime should merge or prefer those settings over the built-in registry entry.

extent analysis

TL;DR

The image tool should prefer user-configured provider settings from openclaw.json over the built-in pi-ai model registry entry to fix the routing issue for zai/glm-5v-turbo.

Guidance

  • Verify that the openclaw.json configuration includes the correct baseUrl and api settings for the zai provider.
  • Check if the modelRegistry.find() function in image-DR5h04LW.js can be modified to prioritize user-configured settings over built-in registry entries.
  • Consider adding a fallback mechanism to use the user-configured provider settings when the built-in registry entry is not found or returns an error.
  • Test the image tool with a different model or provider to isolate the issue and confirm that the problem is specific to zai/glm-5v-turbo.

Example

No code snippet is provided as the issue is related to the configuration and prioritization of provider settings.

Notes

The suggested fix assumes that the user-configured provider settings in openclaw.json are correct and should take precedence over the built-in pi-ai model registry entry. Further investigation may be needed to determine the root cause of the issue and to ensure that the proposed solution does not introduce any unintended consequences.

Recommendation

Apply a workaround by using a subagent with a different provider's vision model (e.g., google-gemini-cli/gemini-3-flash-preview) for image analysis tasks until a permanent fix is implemented. This allows users to continue using the image tool with alternative providers while the issue with zai/glm-5v-turbo is being addressed.

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

The image tool should use the user-configured zai provider settings (baseUrl, api, apiKey) from openclaw.json to call glm-5v-turbo for image analysis. The same endpoint + model + key pair works correctly when called directly via curl with OpenAI vision-format messages (confirmed 200 OK with valid image description response).

Still need to ship something?

×6

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

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix [Bug]: Image tool ignores user-configured provider baseUrl for zai/glm-5v-turbo, routes to vercel-ai-gateway instead (404) [1 participants]