实测部署 dogfood analyze skill 时,LLM load_skill 拿到 host 绝对路径 `/home/lighthouse/zcbot/skills/analyze`,照 SKILL.md 拼 references 路径调 read → 容器内 namespace 没这条路径(容器只有 /sandbox/skills:ro 这 mount),抓瞎。 修法:LoadSkillTool 加 container_skills_dir 构造参数;agent_builder 在装它时 判 ZCBOT_SANDBOX_BACKEND==docker → 传 "/sandbox/skills",其它 → 保持原 host 绝对路径(开发期 host backend 不破)。 结构性收益:proposal/ppt/research/coding/pymatgen/stats_ml/plot_pub 全部 skill references 在 docker backend 下自动 work,不用一个个改 SKILL.md 教用容器路径。 tests/test_load_skill.py 4 case 锁:host 走 host 路径 / docker 走 /sandbox / 末尾斜杠拼接不双斜杠 / 未知 skill 走原路径。docker executor 15/15 回归 PASS。 部署后:git pull + 重启 agent 进程让新代码生效(SkillRegistry 每请求重建但 LoadSkillTool 实例化在 build_agent 里,需要新进程)。 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| test_disk_quota.py | ||
| test_executor_docker.py | ||
| test_load_skill.py | ||
| test_sandbox_check.py | ||
| test_static_vendor.py | ||