Repository navigation
fix(runtime-host): recover settled scheduled task runs - #4135
Conversation
Generated-by: OpenAI Codex
Astro-Han
left a comment
There was a problem hiding this comment.
Thanks for fixing this recovery boundary. The issue is real: a Scheduled Task fire can already be settled while its Run is still non-terminal, and treating the missing pending fire as a startup invariant prevents the Host from recovering.
This solution keeps the existing authority clean. A missing Run still requires an exact pending-fire match; an existing non-terminal Run is handed to the established Runtime recovery path and durably terminated as app_restarted. The identity and conflicting-fire checks remain fail-closed, and no new persistent state machine is introduced.
Reviewed with Codex and two independent @Reviewer agents. I verified the exact head, recovery ownership, identity boundaries, focused regression coverage, and passing CI.
中文对照
谢谢你修复这个恢复边界。这个问题是真实的:Scheduled Task 的 fire 可能已经 settle,但对应 Run 仍未进入终态;此时继续把 pending fire 视为启动硬约束,会阻止 Runtime Host 恢复。
当前方案保持了清晰的 authority:没有 Run 时仍要求 pending fire 精确匹配;已有非终态 Run 时,则交给既有 Runtime 恢复路径,以 app_restarted 持久化终结。身份和冲突 fire 的检查仍然 fail-closed,也没有引入新的持久状态机。
本次审查使用了 Codex 和两个独立的 @Reviewer 子代理;我核对了精确 head、恢复职责、身份边界、针对性回归测试和 CI 结果。
Summary
app_restartedFixes #4133
Verification
npm run build --workspace @maka/runtime-hostnpx biome checkon all changed filesapp_restartedrecovery regression testgit diff --checkAI use
Select exactly one:
Tool(s) and scope: OpenAI Codex implemented the recovery fix, tests, and validation.
Checklist
Does this PR entail a change in behavior?