Commit Graph

3 Commits

Author SHA1 Message Date
caoqianming 73d07c9560 fix(sandbox): init.sh 放行容器自身 loopback,mermaid 渲染真·终案(bump 0.58.10)
90 天 67 次 timeout 真凶:127.0.0.0/8 DROP 掐死 puppeteer 连 chromium 的
127.0.0.1 DevTools WebSocket(SYN DROP -> TCP 重试 ~127s,恒定 2m15s 超时
+ [object Object] + 零 CPU)。容器 127.0.0.1 是自己 netns 的 lo、到不了宿主,
DROP 无安全收益纯误伤。apply_blocklist 首条 -o lo ACCEPT(v6 同款),
127.0.0.11:53 豁免收编,127/8 与 ::1 DROP 降为 belt-and-suspenders。

服务器全款复刻容器实测:放行前小图也挂 2m14s;放行后小图 3.9s、
真实大图 -w 2800 -s 2 仅 5.2s(1 vCPU 渲大图慢亦为误判)。
之前 probe 全因 --entrypoint bash 绕过 init.sh 无 iptables 而全绿误判。

生效:镜像重建(init.sh COPY 层秒过)+ 回收存量容器。

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-12 10:40:48 +08:00
caoqianming b4931418f3 fix(sandbox): probe_mermaid.sh 临时容器用法补 -i 注释(bump 0.58.9)
不带 -i 时容器 stdin 为空,bash 读 /dev/stdin 静默退出零输出,
探针看似跑完实则没跑(0.58.9 服务器验证实测踩中)。

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-12 10:14:20 +08:00
caoqianming 32bf6ae917 fix(sandbox): docker run 加 --shm-size 修 mmdc 渲 mermaid 挂超时 + bump 0.12.5
容器 /dev/shm 默 docker 64MB,chromium(mmdc/puppeteer)起不来一直挂到 timeout。
实测一个"生图测试"对话:模型裸调 mmdc,自造 puppeteer config 漏 --disable-dev-shm-usage,
连试 6 次全超时烧约 120k token。从根上给 docker run 加 --shm-size(默 512m,
env ZCBOT_SANDBOX_SHM_SIZE / yaml sandbox.shm_size 可配),任何 chromium 路径都不再挂。

- core/sandbox/pool.py: --shm-size 旋钮(优先级同 memory/cpus)
- config/agent.yaml / RUN.md: 新增 shm_size 配置 + env + 故障兜底一行
- deploy/sandbox/probe_mermaid.sh: 实测脚本(区分 chromium 缺包 vs 纯 shm 超时)
- scripts/diag_dump_task.py: 按 email+任务名 dump 对话的诊断脚本
- 已 running 旧容器需重启 web + idle 回收后新起才生效;镜像无需 rebuild

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-14 10:40:45 +08:00