⚠️ Agent failed before reply: All models failed (3): zai/glm-4.7: No API key fou...

2026年03月19日 14:11 状态: processing

🚨 错误信息

⚠️ Agent failed before reply: All models failed (3): zai/glm-4.7: No API key found for provider "zai". Auth store: /home/node/.openclaw/agents/main/agent/auth-profiles.json (agentDir: /home/node/.openclaw/agents/main/agent). Configure auth for this agent (openclaw agents add <id>) or copy auth-profiles.json from the main agentDir. (auth) | zai/glm-5-turbo: No API key found for provider "zai". Auth store: /home/node/.openclaw/agents/main/agent/auth-profiles.json (agentDir: /home/node/.openclaw/agents/main/agent). Configure auth for this agent (openclaw agents add <id>) or copy auth-profiles.json from the main agentDir. (auth) | zai/glm-4.5-air: No API key found for provider "zai". Auth store: /home/node/.openclaw/agents/main/agent/auth-profiles.json (agentDir: /home/node/.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 "zai". Auth store: /home/node/.openclaw/agents/main/agent/auth-profiles.json (agentDir: /home/node/.openclaw/agents/main/agent). Configure auth for this agent (openclaw agents add ) or copy auth-profiles.json from the main agentDir.
译文:未找到提供商"zai"的API密钥。认证存储路径:/home/node/.openclaw/agents/main/agent/auth-profiles.json(代理目录:/home/node/.openclaw/agents/main/agent)。请为该代理配置认证(执行openclaw agents add )或从主代理目录复制auth-profiles.json文件。

2.原因分析


  • 根本原因:OpenClaw代理未配置zai提供商的API密钥,导致无法访问GLM系列模型(glm-4.7/glm-5-turbo/glm-4.5-air)。

  • 发生位置:Agent尝试调用zai模型时,读取auth-profiles.json发现认证信息缺失,触发失败。
  • 3.解决方案


    bash

    1. 为当前代理添加zai提供商认证(替换


    openclaw agents add --provider zai --api-key

    2. 若已有认证文件,直接复制到目标目录


    cp /path/to/main/agent/auth-profiles.json /home/node/.openclaw/agents/main/agent/

    4.️ 预防措施


  • 最佳实践1:部署前用openclaw agents validate检查所有依赖提供商的认证状态,避免运行时缺失。

  • 最佳实践2:将auth-profiles.json纳入版本控制(如Git),并限制文件权限(chmod 600),防止误删或泄露。

  • 推荐工具:使用OpenClaw的--config-check参数预校验配置,或集成密钥管理服务(如Vault)自动注入API密钥。