Keep the host awake while a thread is running #13893
Closed
satyalyadav
started this conversation in
Ideas
Replies: 1 comment
|
Duplicate of #7049 (Ideas — same keep-awake / That thread is still open. #5535 implemented it but was closed unmerged during backlog cleanup, so the gap remains — please continue there (WSL/ |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
The ask
A setting that keeps the host awake while a T3 Code thread is running, and lets it sleep normally once every thread is idle.
Today the only option is to disable the OS idle sleep timer. That solves the mid-turn problem and creates a new one, because the machine never sleeps again and drains the battery long after the work is done. I have been running with the Windows standby timeout set to 0 for this reason and would rather not.
Off by default, in the desktop client settings.
powerSaveBlocker("prevent-app-suspension")in the Electron main process is the whole mechanism. It blocks app suspension only, so display sleep and screen lock policy are untouched.Why the desktop client is the only place this can live
For WSL users this is the part that matters. A WSL agent cannot keep a Windows host awake. Codex's own
prevent_idle_sleeprunssystemd-inhibitinside the WSL namespace, and WSL2 has no power management of its own, so that assertion never reaches the machine that actually powers down. Holding a Windows host awake needs a Windows-side power request, and the only process in the stack that can make one is the desktop client's Electron main process.So for anyone running a local or WSL environment, this is either a T3 Code feature or nothing.
Prior art
#663 asked for this back in March. #5535 built it: 22 files, +612/-13, verified on macOS against
pmset -g assertions. It was closed unmerged during a backlog cleanup.The implementation is not on main, and the macOS-only verification does not cover WSL on Windows or a native Linux desktop, which is where the gap still exists.
Scope
Verification I can do
I have WSL2 on a Windows 11 host. I can build the branch and confirm the assertion appears in
powercfg /requestswhile a turn runs and disappears when the turn settles.systemd-inhibit --listcovers the native Linux case. Happy to open a PR if this is wanted.All reactions