mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #1727] [Feature Request] Native prevent-sleep option during active inference (Windows) #688
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#688
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Normandanny on GitHub (Oct 9, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/1727
Summary
Please consider adding a native, opt-in "Prevent Sleep" feature to Strata.
The goal is simple:
Use Case
I run Strata as a local LLM server on a Windows 11 PC, with Hermes Agent running separately on my NAS and sending inference requests over the local network.
I want the PC to sleep automatically when idle to save electricity, while ensuring that long-running inference tasks are never interrupted by Windows automatic sleep.
Currently, this requires either:
A native implementation would be much cleaner and more reliable.
Proposed Feature
Add an optional setting, such as:
--prevent-sleep-while-busyOr a checkbox in the Strata configuration UI:
Prevent system sleep during inferenceExpected Behavior
The feature should not permanently modify Windows power settings or prevent manually initiated sleep.
Optional: Configurable Idle Grace Period
For AI agent workflows, there may be short gaps between consecutive inference requests while the agent executes tools or processes files.
An optional idle grace period (e.g., 2–5 minutes) would help:
This would help avoid unwanted sleep during multi-step agent workflows.
Implementation Suggestion
On Windows, this could use native Windows power management APIs, such as
PowerCreateRequest,PowerSetRequest, andPowerClearRequest.The implementation should account for concurrent requests and reliably release the power request on completion, cancellation, timeout, or shutdown.
Why This Matters
Strata is well suited for running local LLMs as network inference servers.
For users running unattended AI agents or dedicated home LLM servers, this feature would provide:
Windows support alone would already be very useful. Other platforms could be considered later.
Thanks for considering this feature!
@Niko1221 commented on GitHub (Oct 10, 2026):
Thank you, this is in v0.1.42 as a run-config key (opt-in, default off): "prevent_sleep": true in strata-.json. While at least one request is running or queued, the server keeps Windows awake (SetThreadExecutionState with ES_SYSTEM_REQUIRED, not the display); when it is idle, and when it exits, normal sleep rules are back, so the PC can still sleep between jobs. It does nothing on Linux. It has unit tests with the Windows call mocked, and it was also run on a Windows PC before the release.
@Normandanny commented on GitHub (Oct 10, 2026):
Thank you Niko being so responsive!
@Niko1221 commented on GitHub (Oct 13, 2026):
Thanks for the report. To keep the tracker current we are closing issues older than three days: 0.1.44 is out with a long list of fixes, and many older reports are covered by it or by 0.1.43.1.
If this still happens on 0.1.44, please leave a comment here with your engine log (and the version line it prints), and we will reopen it. A new issue that links this one works too.