Mac Running AI Agents with Lid Closed: Adrafinil Keeps Your Assistant Awake

Published on: 2026-06-29

Mac Running AI Agents with Lid Closed: Adrafinil Keeps Your Assistant Awake

📖 Glossary

AI Box (also known as Agent Computer / Agent PC), is a dedicated local hardware device that runs AI Agents. Pre-installed with an AI agent management system, plug-and-play, running 24/7. Users can remotely command AI to work via Discord, Slack, Telegram, WhatsApp, and more.

Abstract: Closing a MacBook lid triggers sleep, and AI Agents lose connection. The open-source tool Adrafinil bypasses lid sleep via system-level power management, letting MacBooks run continuously with the lid closed. The solution is clever but has limitations. This article explains how it works and why Kaihe AIBOX doesn't need this kind of "wake-up pill."


Anyone running AI Agents on a Mac has felt this pain: lid closes, sleep kicks in, Agent disconnects.

You set up an Agent to run scheduled tasks on your Mac — scrape data every hour, generate reports every morning. Then you close the lid to go to a meeting, come back, and find the Agent stopped the moment you closed the lid. No report generated, no data scraped.

Long-running terminal tasks are the same — run a large-scale data process, close the lid, everything dies.

What Is Adrafinil

Adrafinil is an open-source tool that recently went viral on GitHub. Named after a wakefulness-promoting drug, its function is simple: keep MacBooks running with the lid closed without sleeping.

The mechanism: using macOS system-level power management APIs to modify lid-close behavior. Normally, closing the lid triggers a hardware-level sleep signal. Adrafinil intercepts this signal and overrides the behavior, keeping the system running when the lid closes.

Install it, run one command: adrafinil enable. With the lid closed, the Mac keeps running, Agents stay connected, scheduled tasks execute normally.

Body Image

Clever Solution, Clear Limitations

Adrafinil solves the lid-sleep problem but brings side effects:

Heat and battery. With the lid closed, heat dissipation worsens (MacBook vents are at the hinge), and temperatures rise significantly during sustained operation. Long closed-lid sessions may trigger thermal throttling. On MacBook Airs without fans, this is worse. Battery drain is severe — roughly 15-20% per hour in closed-lid operation.

System compatibility. Adrafinil relies on macOS power management APIs. Every major macOS update can break the tool. Users wait for the developer to adapt.

Security risk. Modifying system-level power policy requires administrator privileges. A third-party tool with this level of access creates a security surface. While Adrafinil is open source and code can be audited, not everyone has the capability to review it.

The closed-lid paradox. You use a Mac to run Agents because the Mac is right there. But closed-lid operation means you're not using the screen — the Mac becomes a "server that happens to have a screen." If you don't need the screen, why not just use a device without one?

Hermes Agent Users' Problem

Hermes Agent in the OpenClaw ecosystem is an AI Agent framework running on computers. Many users host it on MacBooks and naturally run into the lid-sleep problem.

Typical scenario: MacBook is used on the go during the day, placed on a desk to run Hermes Agent at home at night. But nobody wants the lid open taking up desk space, yet closing the lid risks Agent disconnection. Adrafinil is designed for this exact scenario.

The problem: this solution essentially repurposes a laptop as a server. It works, but it's not designed for continuous operation.

Body Image

Kaihe AIBOX Doesn't Need a Wake-Up Pill

Kaihe AIBOX is designed from the ground up as a 24/7 device. Lid sleep doesn't exist — because there's no lid to close.

Using a local multi-Agent + cloud LLM edge-cloud collaborative architecture, multiple Agents run continuously on the local device. The device is much smaller than a MacBook, fits on any desk without taking much space, has thermal design optimized for continuous operation, and draws under 30W — versus a MacBook running closed-lid at roughly 50-80W.

Hermes Agent can run directly on Kaihe AIBOX without a MacBook as host. Agent scheduled tasks, data processing, and WeChat notifications run continuously without any sleep policy interference. Your MacBook closes its lid and goes wherever you go — the Agent keeps working on Kaihe AIBOX.

Adrafinil solves the problem of "forcing a device that shouldn't act as a server to act as one anyway." Kaihe AIBOX's approach is different: give you a device designed to be a server from the start.

Data Sources

This article references Adrafinil GitHub project documentation, macOS power management developer docs, and OpenClaw community discussions.

-#KaiheAIBOX #AIAgent #OpenSource #ArtificialIntelligence


Kaihe AIBOX | The Agent Computer That Works 7×24 for You · AI Agent

Recommended Products

A1 Home Entry A1 Pro Enhanced A2 Professional A2 Pro Advanced X1 Enterprise G1 Flagship
© KAIHE AI - Agent Computer Specialist