Skip to content

[Bug] imageModel调用火山引擎API返回404错误 #67976

@279759781

Description

@279759781

问题描述

OpenClaw配置imageModel.primaryvolcengine-plan/doubao-seed-2.0-pro后,当用户发送图片时,OpenClaw内部的image工具调用火山引擎API返回404错误

环境信息

  • OpenClaw版本:2026.4.14
  • 配置的imageModel:volcengine-plan/doubao-seed-2.0-pro
  • 火山引擎API:https://ark.cn-beijing.volces.com/api/coding/v3/chat/completions

问题现象

1. OpenClaw内部调用失败

当用户发送图片时,OpenClaw的image工具返回错误:

<active_memory_plugin>
LLM request failed: provider rejected the request schema or tool payload.
</active_memory_plugin>

或404错误。

2. 直接调用API成功

使用Python直接调用同一个API,完全正常

import base64, requests

with open('image.jpg', 'rb') as f:
    img = base64.b64encode(f.read()).decode()

response = requests.post(
    'https://ark.cn-beijing.volces.com/api/coding/v3/chat/completions',
    headers={
        'Authorization': 'Bearer <API_KEY>',
        'Content-Type': 'application/json'
    },
    json={
        'model': 'doubao-seed-2.0-pro',
        'messages': [{
            'role': 'user',
            'content': [
                {'type': 'text', 'text': '描述这张图片的内容'},
                {'type': 'image_url', 'image_url': {'url': f'data:image/jpeg;base64,{img}'}}
            ]
        }],
        'max_tokens': 1000
    },
    timeout=60
)
# 状态码: 200 ✅
# 正常返回图片描述内容

3. 文本模型正常

OpenClaw内部调用火山引擎的文本模型(不带图片)完全正常,只有imageModel(多模态)失败。

可能原因

  1. OpenClaw内部image工具的请求格式不正确

    • 可能使用了错误的endpoint
    • 可能请求body格式不符合火山引擎API要求
  2. 模型ID映射问题

    • OpenClaw可能使用了内部映射的模型ID,而非配置文件中指定的ID
  3. 多模态请求处理逻辑有bug

    • 图片base64编码方式不对
    • content数组格式不对

临时解决方案

创建了自定义image-recognition技能,绕过OpenClaw的imageModel工具,直接调用火山引擎API。

期望修复

  1. 修复OpenClaw内部image工具对火山引擎API的调用逻辑
  2. 或者提供更清晰的错误信息(当前只显示404,没有具体原因)
  3. 在文档中说明各provider的imageModel兼容性

配置文件

{
  "agents": {
    "defaults": {
      "model": {
        "primary": "baiduqianfancodingplan/glm-5"
      },
      "imageModel": {
        "primary": "volcengine-plan/doubao-seed-2.0-pro"
      }
    }
  }
}

补充信息

  • 用户环境:飞书平台
  • 发现时间:2026-04-17
  • OpenClaw运行环境:Linux 服务器

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions