Agent failed before reply: All models failed (2): custom-demo-hoha-ai-18124/Qwen...

2026年03月18日 20:33 状态: processing

🚨 错误信息

Agent failed before reply: All models failed (2): custom-demo-hoha-ai-18124/Qwen3: No API key found for provider "custom-demo-hoha-ai-18124". Auth store: /root/.openclaw/agents/main/agent/auth-profiles.json (agentDir: /root/.openclaw/agents/main/agent). Configure auth for this agent (openclaw agents add <id>) or copy auth-profiles.json from the main agentDir. (auth) | anthropic/claude-opus-4-6: No API key found for provider "anthropic". Auth store: /root/.openclaw/agents/main/agent/auth-profiles.json (agentDir: /root/.openclaw/agents/main/agent). Configure auth for this agent (openclaw agents add <id>) or copy auth-profiles.json from the main agentDir. (auth). Logs: openclaw logs --follow

🤖 AI解决方案

报错分析报告

1.错误翻译



原文:No API key found for provider "custom-demo-hoha-ai-18124";No API key found for provider "anthropic"
译文:未找到提供商“custom-demo-hoha-ai-18124”的API密钥;未找到提供商“anthropic”的API密钥

2. 原因分析


  • 根本原因:代理(Agent)调用模型时,未在认证存储(auth-profiles.json)中配置custom-demo-hoha-ai-18124anthropic两个提供商的API密钥。

  • 发生位置/root/.openclaw/agents/main/agent/auth-profiles.json文件缺失目标提供商的密钥记录。
  • 3.解决方案


    通过OpenClaw命令配置API密钥:
    bash

    为custom-demo-hoha-ai-18124提供商添加API密钥(替换YOUR_KEY为实际值)


    openclaw agents add custom-demo-hoha-ai-18124 --api-key YOUR_KEY

    为anthropic提供商添加API密钥(替换YOUR_ANTHROPIC_KEY为实际值)


    openclaw agents add anthropic --api-key YOUR_ANTHROPIC_KEY

    或复制现有认证文件(若主目录有备份):
    bash
    cp /path/to/main/agentDir/auth-profiles.json /root/.openclaw/agents/main/agent/

    4. 预防措施


  • ✅ 部署代理前,通过openclaw agents add预配置所有依赖模型的API密钥,避免运行时缺失。

  • ✅ 使用密钥管理工具(如HashiCorp Vault)集中存储密钥,定期校验auth-profiles.json完整性。
  • ---
    :修复后可通过openclaw logs --follow验证日志是否正常。