Commit 10b9d92c54a4d26b7e1a29ddbf984bef28d3c5d2
1 parent
6c4962fe
docs: HANDOFF.md 加 4 条本轮新踩的坑
- pgrep -f 在 su shell 下自匹配的 spawn 风暴 / 永远不重启二选一 - start-ar.sh dash wrapper 触发 phone 上 hermes-snap hook 污染 *.js 末尾 - HERMES_TIMEOUT 120s 在 turns=9 长 context 下偶发不够 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Showing
1 changed file
with
3 additions
and
0 deletions
server/services/wechat/HANDOFF.md
| ... | ... | @@ -287,6 +287,9 @@ pkill -f auto-reply.js |
| 287 | 287 | | `Gateway failed to start! setsid: exec python: No such file or directory` | `su -c` PATH 缺 termux bin | 用 `su u0_a327 -c 'export PATH=/data/data/com.termux/files/usr/bin:$PATH; bash start-gateway.sh'` | |
| 288 | 288 | | `pgrep -f com.tencent.mm` 找不到微信 | Android 把 `cmdline` 设成 `zygote64`,`-f` 不匹配 | 用 `pgrep -x com.tencent.mm`(匹配 `/proc/PID/comm`) | |
| 289 | 289 | | 频繁 `403 quota exhausted` | LLM 后端配额耗尽 | 切换 provider,见第 5 节 | |
| 290 | +| 守护脚本里 `pgrep -f node.*auto-reply.js` 永远返 true(导致永远不重启 / 0 次启动)或永远返 false(导致 spawn 风暴) | `pgrep -f` 在 `su -c "..."` 包装下会**自匹配**自己 shell 的 cmdline;如果改用 PID 文件,`$!` 抓到的是 `sh -c` wrapper PID(comm=sh)而不是 node 子进程 | 用 `su -c "ps -ef \| grep -E node.auto-reply.js \| grep -v sh.-c \| grep -v grep"` 精确匹配 "node auto-reply.js" 实进程;pattern 用 `.` 占位单字符避免嵌套引号 | | |
| 291 | +| 部署 JS 后 node 启动报 `SyntaxError: Invalid regular expression flags` 指向不存在的行号(文件 wc 看是干净的) | phone 上某 claude-run/hermes 会话的 shell snapshot hook 在 dash 启动时尝试写 `/data/local/tmp/hermes-snap-*.sh` 失败,错误以**追加方式注入到 hermes-wechat/*.js 末尾** | 部署用 `dd if=src of=dst` 而不是 `cp`;启动 node 时直接 `su -c 'cd X && env... nohup node ...'`,不经 start-ar.sh / dash wrapper | | |
| 292 | +| `[HERMES] API timeout` / `socket hang up` 在 turns=9 多上下文场景下偶发 | Moonshot kimi-k2.6 长 context LLM call 可达 60s+,旧的 `HERMES_TIMEOUT=120000` 偶发不够 | 启动 env 设 `HERMES_TIMEOUT=180000`(3 分钟),keepalive.sh 已内联 | | |
| 290 | 293 | |
| 291 | 294 | --- |
| 292 | 295 | ... | ... |