Skip to content

[Bug] 图片预处理链路未做格式归一化,导致部分 API 在多模态识别 WebP 时失败 #9743

Description

@afafrdgegreg

Description

在使用多模态模型(包括智谱 GLM-4.6V-Flash 和 Moonshot Kimi-K2.6)识别 WebP 格式图片时,API 返回 400 错误,错误码 1210,提示"图片输入格式/解析错误"。

Reproduction Steps

使用智谱 GLM-4.6V-Flash或agnes
向 AstrBot 发送一张 WebP 格式的图片
BOT 调用多模态模型(Kimi/智谱)识别图片
返回 400 错误,显示日志

AstrBot Version

v4.27.3

Operating System

Linux

Deployment Method

python uv

Message Platform Adapter

Onebot v11

Error Log

[2026-08-19 09:35:10.048] [Plug] [ERRO] 获取图片描述失败: Error code: 400 - {'error': {'code': '1210', 'message': '图片输入格式/解析错误'}}
[2026-08-19 09:35:13.450] [Core] [ERRO] 处理图片描述失败: Error code: 400 - {'error': {'code': '1210', 'message': '图片输入格式/解析错误'}}
[2026-08-19 09:58:22.693] [Core] [WARN] 图片格式转换失败,使用原始数据: a bytes-like object is required, not 'str'

Supplementary Information

fix.txt
123.txt

Checklist

  • I have searched the Issue list for related issues and could not resolve the problem, or this issue has never been reported before.
  • I have tried disabling all plugins to rule out issues caused by plugins.
  • The issue I am reporting is related to AstrBot itself, not to a specific plugin.
  • I have read and agree to the project's Code of Conduct.
  • (Optional) I am willing to submit a PR to help fix this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:providerThe bug / feature is about AI Provider, Models, LLM Agent, LLM Agent Runner.bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions