Skip to content

Node-based terminal manager for AI coding agents — tmux-backed terminals and parallel agent sessions as draggable nodes on an infinite pan/zoom canvas. macOS, Linux, and a browser Server Edition.

feat(keep-awake): lower the battery floor to 5%

review2e89a650f972
diff --git a/README.md b/README.md
index 2bc3ff8be..8bab7a895 100644
--- a/README.md
+++ b/README.md
@@ -153,7 +153,7 @@ Gemini / GitHub Copilot / opencode / Grok / custom) · 📝 **Sticky note** (lin
from your phone — plus push notifications and a mobile board view.
- **Power & sleep** — while an agent is working, nodeterm keeps the machine from
idle-sleeping, and lets go the moment it finishes (on by default; toggle in the setup
- tour or Settings → Behavior). It lets the machine sleep anyway on battery below 20% or
+ tour or Settings → Behavior). It lets the machine sleep anyway on battery below 5% or
when the machine runs critically hot. No app can hold a machine awake through a closed lid
(a Mac with the lid closed stays awake only while plugged in with an external display) —
for overnight runs keep the laptop open and plugged in, or run the agents on a box
diff --git a/src/core/keep-awake-power.test.ts b/src/core/keep-awake-power.test.ts
index 1b66620a3..a00a6dbbe 100644
--- a/src/core/keep-awake-power.test.ts
+++ b/src/core/keep-awake-power.test.ts
@@ -41,11 +41,11 @@ describe('power guard', () => {
})
it('blocks on battery below the floor, allows at the floor', async () => {
- const { guard, state } = harness({ onBattery: true, percent: 19 })
+ const { guard, state } = harness({ onBattery: true, percent: 4 })
await guard.refreshBattery()
expect(guard.allows()).toBe(false)
- expect(guard.blockReason()).toMatch(/19%/)
- state.percent = 20
+ expect(guard.blockReason()).toMatch(/4%/)
+ state.percent = 5
await guard.refreshBattery()
expect(guard.allows()).toBe(true)
})
@@ -87,7 +87,7 @@ describe('power guard', () => {
})
it('notifies on refresh and logs only when the verdict changes', async () => {
- const { guard, state, changes, logs } = harness({ onBattery: true, percent: 10 })
+ const { guard, state, changes, logs } = harness({ onBattery: true, percent: 3 })
await guard.refreshBattery()
await guard.refreshBattery()
expect(changes.count).toBe(2)
diff --git a/src/core/keep-awake-power.ts b/src/core/keep-awake-power.ts
index da6bef145..ade47a93c 100644
--- a/src/core/keep-awake-power.ts
+++ b/src/core/keep-awake-power.ts
@@ -23,7 +23,7 @@ import { promises as fsp } from 'fs'
import path from 'path'
/** On battery below this percent, keep-awake lets the machine sleep. */
-export const KEEP_AWAKE_BATTERY_FLOOR_PCT = 20
+export const KEEP_AWAKE_BATTERY_FLOOR_PCT = 5
/** How often the battery level is re-read while holding on battery. */
export const KEEP_AWAKE_BATTERY_POLL_MS = 60_000
diff --git a/src/renderer/components/onboarding/OnboardingFlow.tsx b/src/renderer/components/onboarding/OnboardingFlow.tsx
index c18fef137..797c66904 100644
--- a/src/renderer/components/onboarding/OnboardingFlow.tsx
+++ b/src/renderer/components/onboarding/OnboardingFlow.tsx
@@ -461,7 +461,7 @@ export function OnboardingFlow({ onClose }: { onClose: () => void }) {
<p>
Closing the lid still sleeps the machine — keep it open and plugged in for
overnight runs (on a Mac, a closed lid works when plugged in with an external
- display). On battery below 20%, or when the machine runs critically hot, it is
+ display). On battery below 5%, or when the machine runs critically hot, it is
allowed to sleep.
</p>
<div className="onb-toggle-row">
diff --git a/src/renderer/components/settings/sections/BehaviorSection.tsx b/src/renderer/components/settings/sections/BehaviorSection.tsx
index 3851ccc9d..b1aaa32c9 100644
--- a/src/renderer/components/settings/sections/BehaviorSection.tsx
+++ b/src/renderer/components/settings/sections/BehaviorSection.tsx
@@ -444,7 +444,7 @@ export function BehaviorSection({ isActive }: { isActive: boolean }): React.JSX.
<SearchableRow {...ROWS.keepAwake}>
<FieldRow
label="Keep awake while agents work"
- description="Holds off idle sleep while a local agent is running. Lets the machine sleep on battery below 20% or when it runs critically hot. A closed lid still sleeps the machine, except on macOS when plugged in with an external display connected."
+ description="Holds off idle sleep while a local agent is running. Lets the machine sleep on battery below 5% or when it runs critically hot. A closed lid still sleeps the machine, except on macOS when plugged in with an external display connected."
control={
<Switch
checked={settings.keepAwakeWhileAgentsWork}