Claude 常见问题
使用前说明
- OpenClaw 中的问题如果在下面有对应条目,可以参考相应解决方法。其他问题暂时没有处理办法,因为 Anthropic 不允许在 OpenClaw 中使用 Claude。
- 文档会持续更新,有新的问题可以提出。
- 文档中涉及 Claude code 的操作,如果文字说明不够清楚,建议搜索对应步骤。
- 这里主要收录请求体和兼容性问题。其他问题可以使用
Alt + A截图并翻译错误信息。
1. messages: text content blocks must be non-empty
出现原因: 使用 OpenAI 格式调用 /v1/chat/completions 接口时,模型调用工具会返回 content 为空的返回体,再次请求时就会报错。
解决方法:
- 使用 Claude 原生格式调用
/v1/messages接口。 - 在 Claude code 中使用时,点击右侧蓝字查看解决方案:Anthropic Claude Code issue #23390。
2. invalid beta flag
出现原因: 使用 Claude code 调用 AWS 资源时,Claude code 会传入一些 AWS 不支持的 beta flag。
解决方法: 更新 Claude code,并加入环境变量 CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1。最好在 settings.json 中也加入这个参数,然后重新打开终端。
3. Assistant message prefills 不受支持
This mode does not support assistant message prefills. The conversation must end with a user message.
出现原因: 请求体以模型回复结尾,没有新的用户输入。
解决方法: 添加新的用户输入后再发送请求。
4. max_tokens 小于 thinking.budget_tokens
'max_tokens' must be greater than 'thinking.budget_tokens'.
出现原因: max_tokens 设置得比 budget_tokens 小。
解决方法: 调大 max_tokens,或者调小 budget_tokens。
5. Request contains an invalid argument
出现原因: 请求体中存在不合法的参数。通常是上下文含有不合法数据或参数,或者 MCP 的 JSON 使用了不支持的关键词。
解决方法:
- 重新打开 Claude code,开始新的对话。
- 禁用 MCP,再逐个启用进行排查。
6. 所选模型不存在或无权访问
There's an issue with the selected model (claude-opus-4-6-thinking). It may not exist or you may not have access to it. Run /model to pick a different model.
出现原因: 官方 bug。
解决方法: 点击右侧蓝字查看解决方案:Antigravity Manager issue #1756。
7. tool_result 找不到对应的 tool_use
unexpected tool_use_id found in tool_result blocks: toolu_xxxxx. Each tool_result block must have a corresponding tool_use block in the previous message.
出现原因: 在 Claude code 中可能是尚未修复的官方问题。使用 OpenAI 格式时,arguments 应该是 JSON 字符串,即使没有参数也应该传入 "{}"。Bedrock 的 OpenAI 兼容层可能因解析空字符串失败而丢失或破坏 tool_use,导致后续 tool_result 找不到对应项。
解决方法:
- 重新打开 Claude code。
- 把
arguments的值改成"{}"。
8. Extra inputs are not permitted
出现原因: 使用 AWS 资源时传入了不支持的参数,MCP 定义与 Anthropic 要求不一致,或者通过 OpenAI 格式传入了不允许的参数。
解决方法:
- 检查报错指出的参数,并在官方文档中确认该参数是否受支持。
- 点击右侧蓝字查看解决方案:Anthropic Claude Code issue #11678。
- 改用 Claude 原生格式调用
/v1/messages接口。
9. tool_reference 类型不匹配
Input tag 'tool_reference' found using 'type' does not match any of the expected tags: 'document', 'image', 'search_result', 'text'
可能原因: AWS 与 Claude code 不兼容,或者是 Claude code 本身的问题。
解决方法: 点击右侧蓝字查看解决方案:Anthropic Claude Code issue #14884。