Skip to content

fix(runtime-host): recover settled scheduled task runs - #4135

Merged
Astro-Han merged 1 commit into
apache:mainfrom
me2seeks:fix/4133-scheduled-task-recovery
Aug 29, 2026
Merged

Astro-Han merged 1 commit into
apache:mainfrom
me2seeks:fix/4133-scheduled-task-recovery

Conversation

@me2seeks

Copy link
Copy Markdown
Contributor

Summary

  • recover a non-terminal ScheduledTask Run when its pending fire was already settled
  • ignore a newer fire for a different turn while rejecting conflicting identity for the same turn
  • let existing Runtime recovery durably terminate the interrupted Run as app_restarted

Fixes #4133

Verification

  • npm run build --workspace @maka/runtime-host
  • npx biome check on all changed files
  • ScheduledTask coordinator recovery regression test
  • Root-turn app_restarted recovery regression test
  • git diff --check

AI use

Select exactly one:

  • No generative tool made a substantive contribution
  • Generative tooling made a substantive contribution

Tool(s) and scope: OpenAI Codex implemented the recovery fix, tests, and validation.

Checklist

  • Tests cover the change and fail without it
  • Lint, format, typecheck and the affected suites pass locally

Does this PR entail a change in behavior?

  • Yes — described under Summary above
  • No

@github-actions github-actions Bot added the effort/M Under 500 readable lines label Aug 29, 2026

@Astro-Han Astro-Han left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 结果。

@Astro-Han
Astro-Han merged commit 2800680 into apache:main Aug 29, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

effort/M Under 500 readable lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Runtime Host startup fails when a ScheduledTask admission outlives its pending fire

2 participants