feat(sleep-inhibitor): add Linux and Windows idle-sleep prevention#11766
feat(sleep-inhibitor): add Linux and Windows idle-sleep prevention#11766yvolovich-cyber merged 23 commits intomainfrom
Conversation
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 42fe936b61
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review thoroughly please |
There was a problem hiding this comment.
Pull request overview
Extends codex-utils-sleep-inhibitor from macOS-only to include Linux and Windows backends for preventing idle system sleep during active turns, and updates feature staging to mark prevent_idle_sleep as Experimental on those OSes.
Changes:
- Add Linux inhibitor backend using
systemd-inhibitwithgnome-session-inhibitfallback. - Add Windows inhibitor backend using Win32 power request handles (
PowerCreateRequest/PowerSetRequest/PowerClearRequest). - Wire platform selection in
codex-utils-sleep-inhibitorand mark the feature Experimental on macOS/Linux/Windows.
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
codex-rs/utils/sleep-inhibitor/src/windows_inhibitor.rs |
New Windows backend using Win32 power requests. |
codex-rs/utils/sleep-inhibitor/src/linux_inhibitor.rs |
New Linux backend that spawns systemd-inhibit or gnome-session-inhibit. |
codex-rs/utils/sleep-inhibitor/src/lib.rs |
Select Linux/Windows backends by target OS; dummy backend for others. |
codex-rs/utils/sleep-inhibitor/Cargo.toml |
Add target-specific deps (notably windows-sys). |
codex-rs/core/src/features.rs |
Mark prevent_idle_sleep Experimental on macOS/Linux/Windows. |
codex-rs/Cargo.lock |
Lockfile updates for new Windows dependency. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 420fcae545
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex please review |
5c956a3 to
9e122be
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5c956a3209
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9e122beedf
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
|
Codex Review: Didn't find any major issues. Swish! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
97a4bac to
e182331
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e182331dc7
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 6 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@codex review please |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4c2c3d93df
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0af4813bc1
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
cc822f4 to
9a54a06
Compare
|
@codex review |
|
@lopopolo-openai addressed. I added the Linux invariant unit test for |
2d5f3fa to
1e8b7d2
Compare
Background
Summary
codex-utils-sleep-inhibitorwith Linux and Windows backends while preserving existing macOS behaviorsystemd-inhibit(--what=idle --mode=block) when availablegnome-session-inhibit(--inhibit idle) when availablePowerCreateRequest+PowerSetRequest/PowerClearRequest) withPowerRequestSystemRequiredprevent_idle_sleepExperimental on macOS/Linux/Windows; keep under development on other targetsTesting
just fmtcargo test -p codex-utils-sleep-inhibitorcargo test -p codex-core features::tests::cargo test -p codex-tui chatwidget::tests::just fix -p codex-utils-sleep-inhibitorjust fix -p codex-coreSemantics and API references
systemd-inhibit/ login1 inhibitor model:PowerCreateRequest:PowerSetRequest:PowerClearRequest:SetThreadExecutionState(alternative baseline API):Chromium vs this PR
Why we differ from Chromium
systemd-inhibit,gnome-session-inhibit) instead of linking a Linux D-Bus client in this crate.codex-utils-sleep-inhibitordependency-light and avoid Linux CI/toolchain fragility from new native D-Bus linkage, while preserving the same runtime intent (hold an inhibitor while a turn runs).display::Screen::SuspendScreenSaver()in its UI stack.codex-rsdoes not have that display abstraction in this crate, so this PR scopes Linux behavior to process-level sleep inhibition only.PowerRequestSystemRequiredonly.