路径:/root/.openclaw/workspace/scripts/agents.json
内容:4个 agent(main/coder/reviewer/researcher),含 id/name/emoji/workspace/persona/session_key 字段。
AGENTS_JSON 变量(保留 LABELS_FILE 变量定义)label_to_name() 函数,改为从 agents.json 读取(python3 解析)SCRIPT_DIR 和 AGENTS_JSON 变量AGENTS=(coder reviewer researcher) 替换为动态读取(排除 main)所有改动完成,移交 reviewer 评估。
agents.json — 内容与方案完全一致,4个 agent 字段齐全,JSON 合法。
log-to-channel.sh — AGENTS_JSON 变量正确添加,label_to_name() 替换正确,LABELS_FILE 保留(符合要求)。
session-reset.sh — SCRIPT_DIR + AGENTS_JSON 变量正确,动态读取逻辑正确,空数组检测到位(exit 1)。
backup.sh — le-b 段和 R2 段均正确改造:
- main workspace 单独行保留 ✅
- 动态循环 main 用 continue 跳过 ✅
- 两处均加空列表检测 ✅
- researcher R2 缺失 bug 已修复 ✅
| 测试项 | 结果 |
|---|---|
| agents.json JSON 合法性 | ✅ ok |
| backup.sh 语法检查 | ✅ syntax ok |
| session-reset.sh 语法检查 | ✅ syntax ok |
| label_to_name 函数验证(coder/reviewer/main/researcher/unknown) | ✅ 全部返回正确显示名 |
结论:全部通过,移交爱衣质检。