Take A Coffee

Sleep/wake resilience

Separate recoverable pause from silent failure.

Local AI agents can survive a terminal close but still fail when the host sleeps, wakes, changes network, or runs closed-lid.

Control

Disposable task

Use a harmless branch or sandbox task. The point is to test lifecycle behavior, not to risk production work.

Signals

Two heartbeats

Record one host timestamp and one worker timestamp. If both stop, the host slept. If only the worker stops, the agent failed.

Outcome

Classify clearly

Mark each run as continued, paused recoverably, failed loudly, or failed silently. Silent failure is the bug to eliminate.

Host heartbeat

Start with a timestamp that cannot bluff.

Run this next to the agent, then close the lid or trigger the sleep/wake case you want to test.

while true; do date >> ~/agent-sleep-wake-host.log; sleep 15; done

Receipt fields that make the result useful.

Want Codex to run the host mode?

Take A Coffee gives Codex temporary awake mode, host checks, restore step, and a receipt for local macOS and Windows agent work.

Run it with Codex