← 返回 Skills 市场
lgugeng

mimo-api-fix

作者 Lgugeng · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ 安全检测通过
36
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install mimo-api-fix
功能描述
诊断和修复 mimo-v2.5-pro(或其他 mimo 系列模型)调用失败的问题。当 LLM 请求返回 400 Param Incorrect、provider rejected the request schema or tool payload、或 providerRuntimeFailureKind=sc...
使用说明 (SKILL.md)

mimo-api-fix

问题症状

OpenClaw 调用 mimo-v2.5-pro 时报错:

  • 400 Param Incorrect
  • provider rejected the request schema or tool payload
  • failoverReason: "format"
  • providerRuntimeFailureKind: "schema"

系统会自动 fallback 到其他模型(如 qwen3.5:122b)。

诊断流程

Step 1: 确认 API 端点可用

# 从配置获取 API key 和 baseUrl
API_KEY=$(python3 -c "import json; d=json.load(open('$HOME/.openclaw/openclaw.json')); print(d['models']['providers']['custom']['apiKey'])")
BASE_URL=$(python3 -c "import json; d=json.load(open('$HOME/.openclaw/openclaw.json')); print(d['models']['providers']['custom']['baseUrl'])")

# 测试基础连通性
curl -s "$BASE_URL/models" -H "Authorization: Bearer $API_KEY" | python3 -m json.tool | head -20

Step 2: 测试无工具调用

curl -s "$BASE_URL/chat/completions" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "mimo-v2.5-pro",
    "messages": [{"role":"user","content":"hello, reply with one word"}],
    "max_tokens": 50
  }' | python3 -m json.tool

如果失败 → API 端点本身有问题,不是 OpenClaw 的问题。

Step 3: 测试带工具调用

curl -s "$BASE_URL/chat/completions" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "mimo-v2.5-pro",
    "messages": [{"role":"user","content":"what is the weather? use get_weather tool"}],
    "tools": [{"type":"function","function":{"name":"get_weather","description":"Get weather","parameters":{"type":"object","properties":{"location":{"type":"string"}},"required":["location"]}}}],
    "max_tokens": 500
  }' | python3 -m json.tool

检查返回中 finish_reason 是否为 "tool_calls"tool_calls 是否有内容。

Step 4: 检查 OpenClaw 配置

python3 -c "
import json
d = json.load(open('$HOME/.openclaw/openclaw.json'))
for m in d['models']['providers']['custom']['models']:
    if 'mimo' in m.get('id',''):
        print(json.dumps(m, indent=2))
"

关键字段:

  • toolCall: 如果为 false,工具调用被禁用
  • maxTokens: 过高可能导致 API 拒绝
  • reasoning: 某些 API 不支持

Step 5: 检查日志获取精确错误

grep -i "mimo" /tmp/openclaw/openclaw-*.log | grep -i "error\|fail\|400" | tail -10

常见原因和修复

原因 1: 配置热加载竞态条件(最常见)

症状:之前能用,突然报 400,过一会儿又好了

原因:配置热加载瞬间有请求在处理,请求格式不一致

修复:通常无需处理,会自动恢复。如果持续报错,重启 gateway:

openclaw gateway restart

原因 2: toolCall 被误禁用

症状:模型能对话但不能调用工具

检查:查看配置中 toolCall 是否为 false

修复

python3 -c "
import json
f = '$HOME/.openclaw/openclaw.json'
d = json.load(open(f))
for m in d['models']['providers']['custom']['models']:
    if 'mimo' in m.get('id',''):
        m['toolCall'] = True
json.dump(d, open(f,'w'), indent=2, ensure_ascii=False)
"

原因 3: API 端点不支持 function calling

症状:curl 测试带 tools 也返回 400

修复:确认使用的是正确的 mimo-v2.5-pro 端点,不是其他不支持 tools 的模型。

原因 4: 模型名称错误

症状model_not_found 错误

检查:确认配置中 id 字段与 API 端点支持的模型名一致:

curl -s "$BASE_URL/models" -H "Authorization: Bearer $API_KEY" | python3 -c "
import json,sys
d=json.load(sys.stdin)
for m in d['data']:
    print(m['id'])
"

运行诊断脚本

bash ~/.openclaw/workspace/skills/skills/mimo-api-fix/scripts/diagnose.sh
安全使用建议
Before installing or running this skill, confirm your OpenClaw custom provider baseUrl is correct, expect it to make test API calls with your configured API key, and back up ~/.openclaw/openclaw.json before using the repair snippet that changes toolCall.
功能分析
Type: OpenClaw Skill Name: mimo-api-fix Version: 1.0.0 The skill bundle is a diagnostic tool designed to troubleshoot API connectivity and schema issues for 'mimo' model providers. It includes a shell script (diagnose.sh) and markdown instructions (SKILL.md) that read the user's local openclaw.json configuration to extract the API key and base URL for testing purposes. While the skill handles sensitive credentials and modifies configuration files, its actions are transparent, localized to the user's configured environment, and strictly aligned with the stated purpose of fixing API failures.
能力标签
requires-sensitive-credentials
能力评估
Purpose & Capability
The documented behavior matches the stated purpose: it tests the configured mimo-compatible API endpoint, tool-calling support, OpenClaw model settings, and recent logs.
Instruction Scope
The instructions are user-directed shell/Python/curl diagnostics and one scoped repair command that changes toolCall for matching mimo models; there is no evidence of hidden automatic execution.
Install Mechanism
There is no install spec or package installation. The included diagnostic script is visible in the provided artifacts.
Credentials
The skill reads ~/.openclaw/openclaw.json for the custom provider API key/base URL and reads /tmp/openclaw logs, which is proportionate for this diagnostic purpose but sensitive.
Persistence & Privilege
The suggested repair can persistently modify OpenClaw's model configuration and the instructions can restart the gateway, but both are disclosed and user-invoked.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install mimo-api-fix
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /mimo-api-fix 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
初始版本:诊断和修复 mimo-v2.5-pro API 调用失败(400 Param Incorrect、tool calling 格式问题)
元数据
Slug mimo-api-fix
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

mimo-api-fix 是什么?

诊断和修复 mimo-v2.5-pro(或其他 mimo 系列模型)调用失败的问题。当 LLM 请求返回 400 Param Incorrect、provider rejected the request schema or tool payload、或 providerRuntimeFailureKind=sc... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 36 次。

如何安装 mimo-api-fix?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install mimo-api-fix」即可一键安装,无需额外配置。

mimo-api-fix 是免费的吗?

是的,mimo-api-fix 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

mimo-api-fix 支持哪些平台?

mimo-api-fix 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 mimo-api-fix?

由 Lgugeng(@lgugeng)开发并维护,当前版本 v1.0.0。

💬 留言讨论