自动回复调试手册
常见 Bug 模式及修复
1. 回复内容是 hermes 命令或元数据
症状: 回复 hermes --resume xxx 或 Resume this session with:
原因: generate() 从 stdout 提取最后一行,hermes chat 输出末尾是元数据行
修复: 改用文件 I/O——hermes 写报告到文件,orchestrator 读取文件
2. 回复内容是完整 prompt
症状: 回复包含"你是火星人的微信助手..."等 prompt 原文 原因: hermes chat 把 prompt 原样输出到 stdout 修复: 同 #1,文件 I/O 彻底解决
3. 任务没执行但报告很漂亮
症状: hermes 回复"已用 plan agent 拆任务、todolist 已写好",但飞书什么都没有 原因: hermes chat --yolo 优先生成文字报告,跳过实际工具调用 修复: prompt 加"先执行任务,不要先写报告"
4. 同一条消息触发多次
症状: 同一个 msgId 收到多次 ack 和回复 原因: dedup 只在 success 路径持久化,失败/跳过路径没记 修复: 在所有退出路径(success/fail/skip/task_failed)都持久化 msgId
5. 任务报告发到了群里
症状: admin 任务的结果报告出现在 TGO 群,不是私聊
原因: talker 是群 chatroom,不是 sender
修复: admin 任务结果用 sender_wxid 覆盖 talker
6. 删了白名单但还在回复
症状: 在 WeChat Viewer 删除白名单项,群里仍然自动回复
原因: del() 函数没有 .catch(),fetch 静默失败
修复: 加 confirm() + .catch() + HTTP 状态检查
7. hermes 自己往群里发消息
症状: task 执行中 hermes 调 send_text_via_hook 往群里发 原因: hermes 有发送工具权限 修复: reply-task-executor skill 第一条规则"禁止发消息"
hermes chat 命令正确姿势
hermes chat -q "prompt" -s reply-task-executor --yolo -t terminal,file,web
-s reply-task-executor: 加载任务执行 skill--yolo: 自动确认工具调用-t terminal,file,web: 必须带 file,否则 write_file 不可用- GEN_TIMEOUT: 600s(GFW 下 GitHub 访问慢)