Skip to content

Keep the machine awake during preset creation - #4205

Merged
r4victor merged 2 commits into
masterfrom
issue_4202_preset_prevent_sleep
Aug 25, 2026
Merged

Keep the machine awake during preset creation#4205
r4victor merged 2 commits into
masterfrom
issue_4202_preset_prevent_sleep

Conversation

@r4victor

Copy link
Copy Markdown
Collaborator

Fixes #4202. A preset creation session left unattended on a laptop stalls: macOS idles to sleep, the agent's streaming response dies, and every maintenance wake costs a retry. In one session a trial that takes ~25 minutes attended took 2h40m.

  • Hold a caffeinate -i -w <pid> inhibitor for the duration of preset creation on macOS, tied to the dstack process so neither a crash nor a SIGKILL can leave the machine awake; every other platform is a no-op.
  • Include the agent's own error in the retry progress line, which previously reported only that the process had exited without a report.

Verified by hand rather than with unit tests, which here would have been almost entirely monkeypatching. Blocks idle sleep only, so a closed laptop lid still sleeps.

AI assistance: written with Claude Code.

@r4victor
r4victor merged commit a39a764 into master Aug 25, 2026
27 checks passed
@r4victor
r4victor deleted the issue_4202_preset_prevent_sleep branch August 25, 2026 10:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Preset creation stalls because the machine goes to sleep

1 participant