fix: add recheck loop to stop-failure hook for suspend/resume awareness #11

Merged
guochao merged 1 commit from guochao/agent-run:master into master 2026-05-31 07:13:50 +00:00
Owner

Previously the hook used a single thread::sleep for the full duration,
which pauses during system suspend. The process would fail to wake up
on time because sleep time does not advance while suspended.

Replace with a recheck loop that sleeps in short intervals (default
30s, configurable via --recheck-interval-seconds) and uses
SystemTime (wall clock) to detect when the target deadline has
arrived. If wall-clock drift between checks exceeds 60s, log a
warning about possible suspend/resume.

Previously the hook used a single thread::sleep for the full duration, which pauses during system suspend. The process would fail to wake up on time because sleep time does not advance while suspended. Replace with a recheck loop that sleeps in short intervals (default 30s, configurable via --recheck-interval-seconds) and uses SystemTime (wall clock) to detect when the target deadline has arrived. If wall-clock drift between checks exceeds 60s, log a warning about possible suspend/resume.
Previously the hook used a single thread::sleep for the full duration,
which pauses during system suspend. The process would fail to wake up
on time because sleep time does not advance while suspended.

Replace with a recheck loop that sleeps in short intervals (default
30s, configurable via --recheck-interval-seconds) and uses
SystemTime (wall clock) to detect when the target deadline has
arrived. If wall-clock drift between checks exceeds 60s, log a
warning about possible suspend/resume.
guochao merged commit 84ac364f39 into master 2026-05-31 07:13:50 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: public/agent-run#11
No description provided.