Your agent didn't fail. You closed the lid
说明与用途
SleepSwitch 让开发者在 macOS 上长时间运行 AI 代理任务时,即使关闭笔记本盖子也不会被打断,并在电量下降时自动关闭。
问题
Macs sleep when the lid is closed, causing long-running AI agent tasks to terminate mid‑run.
结果
SleepSwitch enables developers to run long AI agent tasks without interruption, even when the laptop lid is closed, and includes a battery guard to prevent overheating.
工作流
- 1. Install SleepSwitch via .pkg or source.
- 2. Launch SleepSwitch; icon shows current state (🌙 normal, ☕️ mode on, ⚠️ partial).
- 3. Click the icon to toggle mode on (prevents all sleep).
- 4. Close the laptop lid; the Mac stays awake and the agent continues.
- 5. When finished, click again to turn mode off or let the battery guard auto‑disable at 20%.
证据
SleepSwitch is a macOS menu bar toggle that stops your Mac from sleeping — lid closed included.
The standard answer is caffeinate -dimsu. It works — right up until you close the lid, at which point the Mac sleeps anyway.
Mode switches itself off once the battery drops to a threshold you pick — 20% out of the box — and, optionally, the instant the power adapter is unplugged.
- 记录日期: 2026-09-06T00:22:31.853Z