Repository navigation
feat(runner): the computer doesn't idle-sleep while the AI is working on it - #260
Merged
Merged
Conversation
… on it On the lab the paired laptop idled to sleep at 08:41 with two tasks mid-run; Autopilot and both runs sat still until 20:00. While the runner has a CLI run or a preview in flight it now resets the system idle timer every 30 s (SetThreadExecutionState, non-continuous — never holds the display, never blocks a sleep the person asks for, and stops as soon as the work ends). Windows only; REMOTE_AGENT_KEEP_AWAKE=off opts out. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018WAdQ7Rm24xss5QDSvXtJB
| var second = awake.Hold(); | ||
| awake.Active.ShouldBe(2); | ||
|
|
||
| first.Dispose(); |
| awake.Active.ShouldBe(2); | ||
|
|
||
| first.Dispose(); | ||
| first.Dispose(); // a double release must not under-count |
| first.Dispose(); // a double release must not under-count | ||
| awake.Active.ShouldBe(1); | ||
|
|
||
| second.Dispose(); |
1 of 2 tasks
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.
Summary
The lab's paired laptop idled to sleep at 08:41 with two tasks mid-run; everything (lab, runner, Autopilot) paused until 20:00 — 11 hours of nothing. While the runner has work in flight (a CLI run in either lane, or a Try-the-app preview) it now resets the Windows idle timer every 30 s (
SetThreadExecutionState(ES_SYSTEM_REQUIRED), non-continuous). It never keeps the display on, never blocks a sleep the person asks for (lid / Start › Sleep), and stops as soon as the work ends.REMOTE_AGENT_KEEP_AWAKE=offopts out. README notes it.Test plan
KeepAwakeTests: opt-out parsing; holds count work in flight and release exactly once.🤖 Generated with Claude Code
https://claude.ai/code/session_018WAdQ7Rm24xss5QDSvXtJB