openclaw - ✅(Solved) Fix [Bug]: 图片上传失败:模型不支持图片,但配置了 input: ["text", "image"] [1 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#65165Fetched 2026-04-12 13:25:15
View on GitHub
Comments
0
Participants
1
Timeline
4
Reactions
0
Author
Participants
Timeline (top)
labeled ×2cross-referenced ×1referenced ×1

发送图片时出现警告,图片被丢弃: warn gateway {"subsystem":"gateway"} parseMessageWithAttachments: 1 attachment(s) dropped — model does not support images

即使模型配置中已经正确设置了 "input": ["text", "image"],图片仍然被拒绝。

Error Message

warn gateway {"subsystem":"gateway"} parseMessageWithAttachments: 1 attachment(s) dropped — model does not support images

Root Cause

发送图片时出现警告,图片被丢弃: warn gateway {"subsystem":"gateway"} parseMessageWithAttachments: 1 attachment(s) dropped — model does not support images

即使模型配置中已经正确设置了 "input": ["text", "image"],图片仍然被拒绝。

Fix Action

Fixed

PR fix notes

PR #65178: fix: case-insensitive model lookup for image support resolution

Description (problem / solution / changelog)

Summary

Fixes image attachment dropping when models are configured via the providers.*.models format with "input": ["text", "image"].

Root cause

The resolveGatewayModelSupportsImages function used case-sensitive model ID matching and required exact provider match, causing configured models (e.g., Qwen/Qwen3.5-35B-A3B) to not be found in the catalog. User-configured models from providers.*.models were also being skipped during catalog lookup.

Fix

  • Made model ID comparison case-insensitive in the lookup by reusing the existing findModelInCatalog helper (which normalizes both provider and model ID)
  • Added a fallback model-only case-insensitive search when no provider is specified, so user-configured models without a matching provider field can still be resolved
  • Made provider matching flexible via the existing normalizeProviderId utility

Files changed

  • src/gateway/session-utils.ts — updated resolveGatewayModelSupportsImages to use case-insensitive lookup
  • src/gateway/session-utils.test.ts — added 3 new test cases for case-insensitive matching and fallback behavior

Testing

All 55 tests in session-utils.test.ts pass, including 3 new tests:

  • matches models case-insensitively when provider is given
  • falls back to model-only case-insensitive search when provider is missing
  • returns false when model-only fallback also finds no match

Fixes openclaw/openclaw#65165

Changed files

  • src/gateway/session-utils.test.ts (modified, +49/-0)
  • src/gateway/session-utils.ts (modified, +14/-5)
RAW_BUFFERClick to expand / collapse

Bug type

Behavior bug (incorrect output/state without crash)

Beta release blocker

No

Summary

发送图片时出现警告,图片被丢弃: warn gateway {"subsystem":"gateway"} parseMessageWithAttachments: 1 attachment(s) dropped — model does not support images

即使模型配置中已经正确设置了 "input": ["text", "image"],图片仍然被拒绝。

Steps to reproduce

  1. 配置模型支持图片(使用 providers.*.models 格式): { "providers": { "modelscope": { "models": [ { "id": "Qwen/Qwen3.5-35B-A3B", "name": "Qwen3 5 35B A3B", "input": ["text", "image"], "contextWindow": 32000, "maxTokens": 32000 } ] } } }

  2. 在聊天中发送图片

  3. 观察日志,看到警告信息

Expected behavior

图片正常被模型接收和描述

Actual behavior

  • 模型不支持图片,即使配置中已经明确指定了 "input": ["text", "image"]
  • 图片被丢弃,显示警告信息
  • 聊天中无法使用图片功能

图片被吞:

  1. 图片带文字:忽略图片,ai回应图片相关内容
  2. 只发送图片:ai直接回HEARTBEAT_OK(可能触发心跳逻辑)

OpenClaw version

OpenClaw 版本:2026.4.11 、2026.4.10

Operating system

Windows11下的Ubuntu-24.04

Install method

nmp global

Model

Qwen/Qwen3.5-35B-A3B

Provider / routing chain

openclaw ->modelscope-> Qwen/Qwen3.5-35B-A3B

Additional provider/model setup details

No response

Logs, screenshots, and evidence

Impact and severity

  • 受影响的用户/系统: 所有使用 providers.*.models 格式配置视觉模型的用户
  • 严重程度: 高(图片上传功能完全不可用)
  • 频率: 100%(每次发送图片都会触发)
  • 后果: 无法在聊天中发送图片,视觉模型无法使用

Additional information

  • 日志显示 catalog 有 851 个模型(内置 + provider 插件动态发现),但用户的模型不在其中
  • 根因是模型查找逻辑过于严格(大小写敏感 + provider 必须匹配)

Catalog 加载时模型被跳过:模型条目没有 provider 字段,导致所有配置的模型被跳过。

模型查找逻辑过于严格:使用大小写敏感匹配 + provider 必须完全匹配,导致 Qwen/ vs qwen/ 不匹配。

临时修复方案: 修改 /usr/local/lib/node_modules/openclaw/dist/session-utils-DxZWUpMB.js,让resolveGatewayModelSupportsImages函数使用大小写不敏感匹配并忽略 provider 不匹配

extent analysis

TL;DR

Modify the resolveGatewayModelSupportsImages function to use case-insensitive matching and ignore provider mismatches to fix the image upload issue.

Guidance

  • Verify that the model configuration is correct and the "input" field includes "image" as specified in the providers.*.models format.
  • Check the catalog loading process to ensure that the model is not being skipped due to missing provider fields.
  • Consider relaxing the model lookup logic to use case-insensitive matching and ignore provider mismatches.
  • Apply the temporary fix by modifying the session-utils-DxZWUpMB.js file to update the resolveGatewayModelSupportsImages function.

Example

No code snippet is provided as the issue does not explicitly state the required code changes.

Notes

The issue seems to be caused by the strict model lookup logic, which is case-sensitive and requires an exact provider match. Relaxing this logic may resolve the issue, but it may also introduce other problems. A more permanent fix may require updating the catalog loading process and model lookup logic.

Recommendation

Apply the workaround by modifying the resolveGatewayModelSupportsImages function to use case-insensitive matching and ignore provider mismatches, as this is the most straightforward solution to resolve the image upload issue.

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

图片正常被模型接收和描述

Still need to ship something?

×6

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

Back to top recommendations

TRENDING