Skip to content

feat(automation): re-arm suspended wait timers after cold boot + log cleanup - #1687

Merged
os-zhuang merged 1 commit into
mainfrom
feat-wait-timer-rearm
Jun 10, 2026
Merged

feat(automation): re-arm suspended wait timers after cold boot + log cleanup#1687
os-zhuang merged 1 commit into
mainfrom
feat-wait-timer-rearm

Conversation

@os-zhuang

Copy link
Copy Markdown
Contributor

Summary

  • Wait-timer re-arm (ADR-0019 follow-up): a timer-wait node's auto-resume one-shot job lives in the job service's process memory — a restart lost the wake-up while the suspended run survived in sys_automation_run, leaving the run paused forever unless resumed externally.
    • wait node now persists the wake deadline as node output (<nodeId>.waitUntil), written to flow variables before the suspend snapshot (both the scheduled and the degraded no-job-service paths)
    • new rearmSuspendedWaitTimers() walks the durable store on boot: overdue deadlines resume immediately; future ones re-schedule the same flow-wait:<runId>:<nodeId> one-shot; approval/screen/signal pauses untouched; double fires absorbed by resume() idempotency
    • AutomationServicePlugin.start() runs the re-arm pass after the flow pull (resume needs flow definitions registered)
  • Log cleanup: leftover console.warn debug statements in start() replaced with ctx.logger.debug/warn

No engine.ts core-traversal changes (per ADR-0031 multi-agent discipline).

Test plan

  • 4 new cross-"restart" tests (two engines sharing one InMemorySuspendedRunStore): future-timer re-arm fires on the new engine; overdue timer resumes inline; signal pauses skipped; no-job-service future timer left suspended
  • pnpm vitest run in service-automation: 10 files / 166 tests green on top of latest main

🤖 Generated with Claude Code

…cleanup
A timer-`wait` node schedules its auto-resume as a one-shot job that lives in
the job service's process memory — a restart lost the wake-up while the
suspended run survived in sys_automation_run, leaving the run paused forever
unless resumed externally (ADR-0019 follow-up).
- wait node: persist the wake deadline as node output (`<nodeId>.waitUntil`),
written to variables before the suspend snapshot, on both the scheduled and
the degraded (no job service) paths
- new `rearmSuspendedWaitTimers()`: walks the durable store on boot — overdue
deadlines resume immediately, future ones re-schedule the same
`flow-wait:<runId>:<nodeId>` one-shot; non-timer pauses untouched; double
fires absorbed by resume() idempotency
- AutomationServicePlugin.start(): run the re-arm pass after the flow pull
(resume() needs flows registered)
- replace leftover console.warn debug statements in start() with ctx.logger
Tests: 4 new cross-"restart" cases (two engines sharing one store) + suite
green (166).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@vercel

vercelBot commented Jun 10, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

ProjectDeploymentActionsUpdated (UTC)
specReadyReadyPreview, CommentJun 10, 2026 1:55pm

Request Review

@os-zhuang
os-zhuang merged commit 193c6c3 into mainJun 10, 2026
12 checks passed
@os-zhuang
os-zhuang deleted the feat-wait-timer-rearm branch June 10, 2026 13:59
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@os-zhuang