feat(vscode): add cross-platform keep-awake toggle - #12974
Conversation
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (27 files)
Previous Review Summary (commit 261b09a)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit 261b09a)Status: No Issues Found | Recommendation: Merge Files Reviewed (26 files)
Reviewed by grok-4.6 · Input: 131.6K · Output: 14.6K · Cached: 750.8K Review guidance: REVIEW.md from base branch |
# Conflicts: # packages/kilo-vscode/webview-ui/agent-manager/i18n/ar.ts # packages/kilo-vscode/webview-ui/agent-manager/i18n/br.ts # packages/kilo-vscode/webview-ui/agent-manager/i18n/bs.ts # packages/kilo-vscode/webview-ui/agent-manager/i18n/da.ts # packages/kilo-vscode/webview-ui/agent-manager/i18n/de.ts # packages/kilo-vscode/webview-ui/agent-manager/i18n/en.ts # packages/kilo-vscode/webview-ui/agent-manager/i18n/es.ts # packages/kilo-vscode/webview-ui/agent-manager/i18n/fa.ts # packages/kilo-vscode/webview-ui/agent-manager/i18n/fr.ts # packages/kilo-vscode/webview-ui/agent-manager/i18n/it.ts # packages/kilo-vscode/webview-ui/agent-manager/i18n/ja.ts # packages/kilo-vscode/webview-ui/agent-manager/i18n/ko.ts # packages/kilo-vscode/webview-ui/agent-manager/i18n/nl.ts # packages/kilo-vscode/webview-ui/agent-manager/i18n/no.ts # packages/kilo-vscode/webview-ui/agent-manager/i18n/pl.ts # packages/kilo-vscode/webview-ui/agent-manager/i18n/ru.ts # packages/kilo-vscode/webview-ui/agent-manager/i18n/th.ts # packages/kilo-vscode/webview-ui/agent-manager/i18n/tr.ts # packages/kilo-vscode/webview-ui/agent-manager/i18n/uk.ts # packages/kilo-vscode/webview-ui/agent-manager/i18n/zh.ts # packages/kilo-vscode/webview-ui/agent-manager/i18n/zht.ts
|
Hello, I'm not sure if this topic is still active, but I created a similar feature for my own needs, which I've been using for a few weeks now. I hadn't seen this PR, and I'm not sure if it's a duplicate. If it is, I apologize, and please feel free to close the PR. |
|
I think this is reasonable to ship as a default-off productivity feature, not as an exception to workstation-security policy. The important distinction is keeping a computer awake versus keeping it unlocked. This implementation makes temporary OS sleep-prevention requests. It does not simulate keyboard/mouse input, request that the display stays on, disable screen locking, or change permanent power settings. Microsoft explicitly documents that the Windows API does not stop the screen saver or prevent user-requested sleep. The safeguards here are concrete:
This is an established product category, not something unique to Kilo. Copilot CLI defaults keep-alive to off, supports explicit session/busy/timed modes, and even documents staying awake while waiting for user input. Claude Desktop and Codex CLI also offer sleep prevention. The Linux primary request here also matches the We should still be clear about the boundary: a locked computer can continue using files, credentials, and the network. A company that requires mandatory suspend or prohibits unattended execution may disallow this. We do not provide a dedicated organization opt-out yet, and we must not bypass device restrictions. Linux can also block manual suspend until the request is released; native Windows/Linux verification remains a checklist item. On that basis, I do not see a reason to block this scoped, opt-in feature merely because it prevents sleep. The defensible claim is that it supports intentional background work without deliberately suppressing locking, not that every corporate policy automatically permits it or that there is zero platform risk. |
What Problem This Solves
Agent sessions can be interrupted by idle system sleep. Add an optional Keep Awake control without changing the agent runtime.
Why This Change Was Made
The PR is limited to the extension: 46 files / 1,380 added lines, down from 75 files / 4,331 added lines (68% fewer additions). Twenty-one files contain only translation strings.
Backend activity tracking, CodeMode hooks, protocol/schema changes, and SDK changes have been removed. The feature uses existing session-status events and snapshots, with no new packages.
User Impact
busyorretry, including background agents and other worktrees using the shared backend.Scope limits: approval waits can still report
busy, so they can keep the computer awake. This PR does not infer exact paused-agent activity or add an organization opt-out. Native control is limited to local VS Code windows.Display sleep and screen locking remain enabled; no user input is simulated. macOS uses
caffeinate -i, Windows requests system sleep prevention only, and Linux inhibitssleep, notidle. Linux can also block manual suspend until Keep Awake is disabled. A locked computer can still use files, network access, and available credentials, so device policy still applies.Evidence
Bun 1.3.14: 4,870 extension unit tests pass (2 platform/existing skips), plus extension typechecks, lint, build, and Knip. The Storybook build also passes. No backend, CodeMode, schema, or SDK diff remains.
Isolated VS Code with a local fake model: verified default-off, remembered notice across reload, conservative busy/approval-wait behavior, and release after a task completes. Real macOS assertions were system-sleep-only and removed on cleanup. Native Windows/Linux verification remains a platform follow-up.
Multi-project toolbar: verified all five controls are inside the header and reachable at 200px, 260px, and 320px sidebar widths. Keyboard and Help open correctly at the minimum width. Added a 200px visual regression story; Linux CI generates its baseline.