openclaw - ✅(Solved) Fix [Bug]: [Bug] image tool 报 Unknown model 当 本地模型 被设为 imageModel 而非主模型时 [2 pull requests, 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#66486Fetched 2026-04-15 06:26:01
View on GitHub
Comments
0
Participants
1
Timeline
4
Reactions
0
Participants
Timeline (top)
cross-referenced ×2labeled ×1referenced ×1

当使用 MiniMax-M2.7 作为主模型,并将 lmstudio/google/gemma-4-e2b 设置为 agents.defaults.imageModel 时,image tool 报错 Unknown model: lmstudio/google/gemma-4-e2b,但同模型作为主模型时可正常识图。

Error Message

4.收到错误:{"error": "Unknown model: lmstudio/google/gemma-4-e2b"} {"error": "Unknown model: lmstudio/google/gemma-4-e2b"}

Root Cause

当使用 MiniMax-M2.7 作为主模型,并将 lmstudio/google/gemma-4-e2b 设置为 agents.defaults.imageModel 时,image tool 报错 Unknown model: lmstudio/google/gemma-4-e2b,但同模型作为主模型时可正常识图。

Fix Action

Fix / Workaround

1.配置 minimax-portal/MiniMax-M2.7 作为主模型(agents.defaults.model.primary) 2.通过 config.patch 将 agents.defaults.imageModel 设置为 lmstudio/google/gemma-4-e2b 3.调用 image tool 分析任意图片 4.收到错误:{"error": "Unknown model: lmstudio/google/gemma-4-e2b"}

PR fix notes

PR #2: fix #66486: fix(image): prepare dynamic models before image tool registry lookup

Description (problem / solution / changelog)

Fixes #66486


Automated PR

Changed files

  • CHANGELOG.md (modified, +35/-7)
  • docs/.generated/plugin-sdk-api-baseline.sha256 (modified, +2/-2)
  • docs/cli/browser.md (modified, +14/-0)
  • docs/gateway/local-models.md (modified, +1/-0)
  • docs/tools/browser.md (modified, +57/-0)
  • extensions/browser/src/browser/cdp.helpers.test.ts (modified, +76/-1)
  • extensions/browser/src/browser/cdp.helpers.ts (modified, +19/-2)
  • extensions/browser/src/browser/chrome.loopback-ssrf.integration.test.ts (added, +70/-0)
  • extensions/browser/src/browser/chrome.test.ts (modified, +11/-5)
  • extensions/browser/src/browser/config.test.ts (modified, +10/-1)
  • extensions/browser/src/browser/config.ts (modified, +5/-1)
  • extensions/browser/src/browser/navigation-guard.test.ts (modified, +17/-2)
  • extensions/browser/src/browser/navigation-guard.ts (modified, +2/-1)
  • extensions/browser/src/browser/routes/tabs.attach-only.test.ts (modified, +2/-2)
  • extensions/browser/src/browser/server-context.availability.ts (modified, +0/-1)
  • extensions/browser/src/browser/server-context.remote-profile-tab-ops.fallback.test.ts (modified, +1/-1)
  • extensions/browser/src/browser/server-context.tab-ops.ts (modified, +2/-2)
  • extensions/browser/src/browser/server-context.tab-selection-state.test.ts (modified, +35/-0)
  • extensions/discord/src/monitor/native-command.commands-allowfrom.test.ts (modified, +2/-2)
  • extensions/discord/src/monitor/native-command.plugin-dispatch.test.ts (modified, +25/-29)
  • extensions/discord/src/monitor/native-command.status-direct.test.ts (added, +200/-0)
  • extensions/discord/src/monitor/native-command.think-autocomplete.test.ts (modified, +6/-2)
  • extensions/discord/src/monitor/native-command.ts (modified, +34/-8)
  • extensions/feishu/src/test-support/lifecycle-test-support.ts (modified, +2/-2)
  • extensions/github-copilot/index.ts (modified, +1/-1)
  • extensions/google/api.test.ts (modified, +71/-1)
  • extensions/google/api.ts (modified, +30/-3)
  • extensions/google/image-generation-provider.test.ts (modified, +27/-0)
  • extensions/google/media-understanding-provider.video.test.ts (modified, +21/-2)
  • extensions/google/provider-policy-api.test.ts (modified, +16/-0)
  • extensions/google/provider-policy.ts (modified, +38/-7)
  • extensions/memory-core/src/memory/index.test.ts (modified, +17/-1)
  • extensions/memory-core/src/memory/provider-adapters.ts (modified, +29/-0)
  • extensions/nextcloud-talk/src/monitor.replay.test.ts (modified, +2/-1)
  • extensions/openai/index.test.ts (modified, +9/-3)
  • extensions/openai/openai-codex-cli-auth.test.ts (modified, +66/-1)
  • extensions/openai/openai-codex-cli-auth.ts (modified, +15/-1)
  • extensions/openai/openai-codex-provider.test.ts (modified, +174/-0)
  • extensions/openai/openai-codex-provider.ts (modified, +72/-14)
  • extensions/openai/shared.ts (modified, +10/-0)
  • extensions/qa-lab/src/scenario-catalog.test.ts (modified, +24/-0)
  • extensions/qa-lab/src/scenario-catalog.ts (modified, +1/-1)
  • extensions/qqbot/src/utils/platform.test.ts (modified, +2/-2)
  • extensions/telegram/src/bot-message-context.dm-threads.test.ts (modified, +11/-4)
  • extensions/telegram/src/bot-message-dispatch.ts (modified, +4/-1)
  • extensions/telegram/src/bot.create-telegram-bot.test.ts (modified, +233/-0)
  • extensions/telegram/src/bot/delivery.resolve-media-retry.test.ts (modified, +10/-1)
  • extensions/telegram/src/bot/delivery.resolve-media.ts (modified, +9/-0)
  • extensions/telegram/src/sequential-key.test.ts (modified, +33/-1)
  • extensions/telegram/src/sequential-key.ts (modified, +32/-0)
  • extensions/telegram/src/topic-name-cache.test.ts (modified, +10/-3)
  • extensions/telegram/src/topic-name-cache.ts (modified, +1/-1)
  • extensions/whatsapp/src/inbound/monitor.ts (modified, +5/-5)
  • package.json (modified, +4/-0)
  • qa/scenarios/empty-response-recovery-replay-safe-read.md (added, +81/-0)
  • qa/scenarios/empty-response-retry-budget-exhausted.md (added, +75/-0)
  • qa/scenarios/reasoning-only-no-auto-retry-after-write.md (added, +90/-0)
  • qa/scenarios/reasoning-only-recovery-replay-safe-read.md (added, +81/-0)
  • scripts/lib/plugin-sdk-doc-metadata.ts (modified, +3/-0)
  • scripts/lib/plugin-sdk-entrypoints.json (modified, +1/-0)
  • src/agents/agent-scope-config.ts (modified, +1/-2)
  • src/agents/context-window-guard.test.ts (modified, +85/-0)
  • src/agents/context-window-guard.ts (modified, +72/-0)
  • src/agents/execution-contract.test.ts (modified, +10/-0)
  • src/agents/execution-contract.ts (modified, +4/-2)
  • src/agents/model-compat.test.ts (modified, +3/-1)
  • src/agents/model-fallback.probe.test.ts (modified, +13/-0)
  • src/agents/openai-completions-compat.test.ts (added, +34/-0)
  • src/agents/openai-completions-compat.ts (modified, +5/-2)
  • src/agents/openai-transport-stream.test.ts (modified, +27/-0)
  • src/agents/pi-embedded-runner/model.provider-runtime.test-support.ts (modified, +23/-6)
  • src/agents/pi-embedded-runner/model.test.ts (modified, +151/-0)
  • src/agents/pi-embedded-runner/model.ts (modified, +29/-4)
  • src/agents/pi-embedded-runner/run.overflow-compaction.harness.ts (modified, +20/-0)
  • src/agents/pi-embedded-runner/run.overflow-compaction.test.ts (modified, +3/-1)
  • src/agents/pi-embedded-runner/run/attempt.context-engine-helpers.ts (modified, +34/-33)
  • src/agents/pi-embedded-runner/run/attempt.spawn-workspace.test-support.ts (modified, +12/-2)
  • src/agents/pi-embedded-runner/run/attempt.spawn-workspace.timeout.test.ts (added, +42/-0)
  • src/agents/pi-embedded-runner/run/attempt.ts (modified, +45/-18)
  • src/agents/pi-embedded-runner/run/setup.ts (modified, +22/-6)
  • src/agents/pi-embedded-runner/tool-result-context-guard.test.ts (modified, +366/-1)
  • src/agents/pi-embedded-runner/tool-result-context-guard.ts (modified, +101/-0)
  • src/agents/sandbox/fs-bridge.e2e-docker.test.ts (modified, +33/-12)
  • src/agents/tools/image-generate-tool.test.ts (modified, +4/-2)
  • src/agents/tools/image-generate-tool.ts (modified, +4/-10)
  • src/agents/tools/media-tool-shared.model-resolution.test.ts (added, +62/-0)
  • src/agents/tools/media-tool-shared.ts (modified, +7/-2)
  • src/agents/tools/music-generate-tool.test.ts (modified, +9/-1)
  • src/agents/tools/music-generate-tool.ts (modified, +3/-1)
  • src/agents/tools/video-generate-tool.test.ts (modified, +9/-1)
  • src/agents/tools/video-generate-tool.ts (modified, +3/-1)
  • src/auto-reply/reply.directive.directive-behavior.e2e-harness.ts (modified, +2/-0)
  • src/auto-reply/reply/reply-media-paths.test.ts (modified, +3/-2)
  • src/auto-reply/reply/reply-media-paths.ts (modified, +3/-1)
  • src/auto-reply/thinking.test.ts (modified, +2/-1)
  • src/channels/plugins/legacy-config.test.ts (modified, +2/-3)
  • src/cli/daemon-cli/install.test.ts (modified, +1/-1)
  • src/cli/exec-approvals-cli.test.ts (modified, +51/-6)
  • src/cli/exec-approvals-cli.ts (modified, +36/-16)
  • src/commands/agent/session.test.ts (modified, +4/-4)

PR #66622: fix #66486: fix(image): prepare dynamic models before image tool registry lookup

Description (problem / solution / changelog)

Fixes #66486


Automated PR

Changed files

  • src/canvas-host/a2ui/.bundle.hash (modified, +1/-1)
  • src/media-understanding/image.test.ts (modified, +117/-0)
  • src/media-understanding/image.ts (modified, +26/-2)

Code Example

{"error": "Unknown model: lmstudio/google/gemma-4-e2b"}

对比证据:
✅ gemma-4-e2b 作为主模型(不设 imageModel):识图正常
❌ gemma-4-e2b 仅设为 imageModel:报 Unknown model
RAW_BUFFERClick to expand / collapse

Bug type

Behavior bug (incorrect output/state without crash)

Beta release blocker

No

Summary

当使用 MiniMax-M2.7 作为主模型,并将 lmstudio/google/gemma-4-e2b 设置为 agents.defaults.imageModel 时,image tool 报错 Unknown model: lmstudio/google/gemma-4-e2b,但同模型作为主模型时可正常识图。

Steps to reproduce

1.配置 minimax-portal/MiniMax-M2.7 作为主模型(agents.defaults.model.primary) 2.通过 config.patch 将 agents.defaults.imageModel 设置为 lmstudio/google/gemma-4-e2b 3.调用 image tool 分析任意图片 4.收到错误:{"error": "Unknown model: lmstudio/google/gemma-4-e2b"}

Expected behavior

image tool 应能正常调用 lmstudio/google/gemma-4-e2b 进行图片识别,与该模型是否为主模型无关

Actual behavior

报错:Unknown model: lmstudio/google/gemma-4-e2b

OpenClaw version

2026.4.11

Operating system

macOS Darwin 25.3.0 (arm64)

Install method

npm

Model

lmstudio/google/gemma-4-e2b(本地 LM Studio,contextWindow: 131072,支持 text + image 输入)

Provider / routing chain

lmstudio(本地 HTTP:127.0.0.1:1234)→ google/gemma-4-e2b

Additional provider/model setup details

"models": { "providers": { "lmstudio": { "baseUrl": "http://127.0.0.1:1234", "api": "anthropic-messages", "models": [{ "id": "google/gemma-4-e2b", "input": ["text", "image"] }] } } }

Logs, screenshots, and evidence

{"error": "Unknown model: lmstudio/google/gemma-4-e2b"}

对比证据:
✅ gemma-4-e2b 作为主模型(不设 imageModel):识图正常
❌ gemma-4-e2b 仅设为 imageModel:报 Unknown model

Impact and severity

Affected users: 使用非 vision 模型作为主模型、同时想用本地 vision 模型识图的用户 Severity: blocks workflow(无法使用指定的本地模型识图) Frequency: always(100% 复现) Consequence: 必须让本地 vision 模型兼任主模型才能使用,增加了不必要的成本或限制

Additional information

初步分析:provider 在 tool 级别的初始化时机差异导致。主模型会话启动时会预初始化整个 provider,但单独作为 imageModel 引用时,lmstudio provider 可能未被正确注册到 image tool 的模型解析上下文中。建议检查 image tool 在解析 imageModel 时是否与主模型共享同一套 provider 初始化逻辑。

extent analysis

TL;DR

The issue can be resolved by ensuring the lmstudio provider is properly registered and initialized for the imageModel in the image tool.

Guidance

  • Verify that the lmstudio provider is correctly configured and initialized for the imageModel by checking the provider's registration logic in the image tool.
  • Check if the imageModel is being parsed and resolved correctly in the image tool, and if it is using the same provider initialization logic as the primary model.
  • Review the models configuration to ensure that the lmstudio provider is properly defined and the google/gemma-4-e2b model is correctly listed as one of its models.
  • Consider adding logging or debugging statements to the image tool to track the provider initialization and model resolution process.

Example

No code example is provided as the issue is more related to configuration and initialization logic.

Notes

The issue seems to be related to the initialization and registration of the lmstudio provider in the image tool. The fact that the model works as the primary model but not as the imageModel suggests a difference in how the provider is initialized and registered in these two cases.

Recommendation

Apply workaround: Modify the image tool to ensure that the lmstudio provider is properly registered and initialized for the imageModel, and that it uses the same provider initialization logic as the primary model. This may involve updating the image tool's configuration or code to handle the provider initialization and model resolution correctly.

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

image tool 应能正常调用 lmstudio/google/gemma-4-e2b 进行图片识别,与该模型是否为主模型无关

Still need to ship something?

×6

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

Back to top recommendations

TRENDING