fix(lifecycle): 修复进程生命周期缺陷,防止投递停滞 (#71) - #72
Open
hugozhu wants to merge 2 commits into
Open
Conversation
ack 之前只在失败时记 monitor.log,成功回执无迹可循——遇到"用户消息有 表情但看不到日志"时无从判断回执到底跑没跑。 新增 _dlog():AGENT_DEBUG 时把 收到/升级/收尾/仅已读 四个生命周期点记到 monitor.log(复用 core.log,与 ack 失败日志同文件同 "ack:" 前缀),均带 msgId,可与 agent-connect.log 入站行同 id 对齐。失败日志不受开关影响,恒记。 验证:test_ack_capability.py 38/38;打桩直连 on_inbound → monitor.log 出现 三行 [agent] ack: 收到/升级/收尾。 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- dws-connect.sh: consumer 退出/收 TERM 时连同 `dws event _bus` 子树一起清, 避免 _bus 被甩成孤儿继续占订阅(新旧 _bus 抢投递 → 投递停滞) - stop.sh / monitor.sh: 新增 stop_extra_cleanup 钩子,按 DWS_PROFILE 精确清扫 进程树够不着的残留 dws event 孤儿;stop.sh 按「bash+路径」双条件杀 monitor - reboot.sh: 用 env -i 干净环境跑 stop/start,使改后的 config 生效 - e2e 脚本: HTTP serve 就绪探测替代裸 sleep + 模型兜底;文本测试 keychain 锁定提示 - unit_test.sh: 补 #71 生命周期回归断言(29 passed) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景
dws event consume会派生dws event _bus子进程持流连接。旧代码kill <consumer>会把_bus甩成孤儿被 init 收养——它继续占着订阅消费消息,重启后新旧_bus抢投递,表象为「投递停滞 / 收不到消息」(#71)。改动
TERM时,连同其dws event _bus子树一起清(_kill_subtree+ EXIT/TERM trap),不再留孤儿。stop_extra_cleanupcustom 钩子,按DWS_PROFILE精确清扫进程树够不着的残留dws event孤儿;stop.sh 按「bash+路径」双条件杀 monitor(含无参数手工启动的)。env -i干净环境跑 stop/start,使改后的config/constants.local.sh生效(避免继承旧 env 压住${VAR:-...}赋值)。测试
bash tests/core/unit_test.sh→ 29 passed, 0 failed(含 8 条 彻底优化:重新审视项目现状并做一次系统性梳理与优化 #71 专项断言)。🤖 Generated with Claude Code