fix(deploy): 重启 daemon 前等待在途 grilling 决策写回 - #7
Merged
Merged
Conversation
make deploy/daemon-recover 会 pkill agent-server 并重启 watcher; 若用户刚在 Kitty 决策 tab 提交答案、kitty-grill 的 detached 写回 子进程还在连 agent-server 的 /agent/chat,请求会被硬切断(EOF/TIMEOUT), 最终弹「Grilling 决策写回失败」。观测:2026-08-22 08:04、2026-09-01 11:45 的写回失败均撞上 make deploy 的重启窗口(journal + session 日志 交叉取证)。 新增 wait-grilling-writebacks 目标:重启前用 pgrep 探测在途 `kitty-grill --writeback` 进程并等待(上限 300s),deploy 插入为 [4a/6],daemon-recover 在 pkill 前执行。pgrep 模式用 [k] 防自匹配。 超时后仅告警不阻塞部署——写回失败本就有桌面提醒与 fresh-session 兜底,可手动重试。
…ing-writebacks # Conflicts: # Makefile
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.
背景
「Grilling 决策写回失败」提醒的根因(三方日志交叉取证):用户提交决策后,kitty-grill 的 detached 写回子进程还在连本地 agent-server(127.0.0.1:8799)的
/agent/chat,此时另一个会话跑make deploy——deploy 第 [4/6] 步pkill headless-agent-server+ 第 [5/6] 步重启 watcher,把在途请求硬切断。观测证据:
agent-server outcome error↔ 同一分钟 watcher 连续重启agent-server unreachable: EOF↔ 11:45:08 / 11:46:13 watcher 重启(由 11:37 session 的make deploy触发)修复
新增
wait-grilling-writebacks目标:重启前用pgrep -f 'kitty-grill --writebac[k]'探测在途写回进程并等待(上限 300s,每秒轮询,每 10s 报一次进度)。deploy插入为[4a/6]——在任何 agent-server/watcher 操作之前排空;daemon-recover在pkill前执行同样的等待;pgrep模式用[k]防自匹配(配方 shell 自身命令行含该字符串字面量)。验证
make --no-print-directory wait-grilling-writebacks(无在途):立即输出无在途 grilling 写回make -n deploy/make -n daemon-recover解析通过,插入点与顺序正确