Open source · Apache-2.0 · All four tools
oc-workers
liveAn OpenClaw assistant on your own Cloudflare account that sleeps when idle and does not lose messages.
oc-workers runs a persistent OpenClaw personal assistant on your Cloudflare account. It replaces moltworker. It sleeps after 5 idle minutes and wakes on a message, a timer or the web UI. The Worker stores and acknowledges every message before the container wakes. The container holds no credentials.
npm install -g oc-workers && ochost init
The problem
A personal agent like OpenClaw must be reachable at any time. If its container stays awake all day, it runs while it does nothing.
A basic scale-to-zero setup like moltworker has other problems. Incoming webhooks time out while the container wakes. A restart wipes SQLite memory. Two containers can write the same state.
Tests and limits
| Sleep/wake cycles | 200 | 0 updates lost, 0 repeated |
| Idle before sleep | 5 min | on channels that can sleep |
| First reply after sleep | up to ~1 min | the container wakes first |
| Messages while asleep | all | stored and acknowledged by the Worker |
Which channels can sleep
Webhook channels let the container sleep between messages. Socket channels need an open connection, so the container stays awake.
| Webhook channels | sleep | Telegram, Slack (HTTP mode), Twilio SMS, WebChat |
| Socket channels | stay awake | WhatsApp, Discord, Slack (socket mode), Signal, Matrix |
How it works
- An inbox at the edge while asleep. A Control Durable Object holds the operation journal, config, credentials, alerts and an inbox. The Worker acknowledges webhooks while the container sleeps, then replays them in order when the container wakes.
- One writer, with crash protection. A Runtime Durable Object per epoch owns the container, on the cf-orbs control plane. Epochs and generations stop two containers from writing the same state. A backup cron catches lost alarms. A supervisor in the container sets cgroup memory limits, restarts gracefully and uses a restart ladder.
- Backups to R2 and no stored keys. Litestream streams SQLite changes to R2 through a Worker gate, so the container holds no R2 key. Control, replication, capabilities and the Sandbox SDK
execand file tools all go through Worker gates. Workers AI runs inference with no external model token.
ContainersDurable ObjectsR2Sandbox SDKWorkers AI
Install and use
You need a Cloudflare account on Workers Paid (the $5 a month plan), because Containers need it.
npm install -g oc-workers && ochost init
After deploy, the assistant sleeps when idle and wakes on webhooks, timers or a visit to the web UI. The docs have the full steps.
Questions
Which chat channels let the container sleep?
Webhook channels: Telegram, Slack in HTTP mode, Twilio SMS and WebChat. Socket channels keep the container awake: WhatsApp, Discord, Slack in socket mode, Signal and Matrix.
What happens if Cloudflare stops the container without warning?
Queued messages stay in the Control Durable Object. Across 200 sleep/wake cycles, none were lost. Litestream keeps the SQLite state in R2.
Do I put OpenAI, Anthropic or R2 keys inside the container?
No. Inference uses Cloudflare Workers AI by default, with no model token. Anthropic works today, with the key held in AI Gateway, outside the container. Storage, control and tool calls go through Worker gates outside the container.
The other tools
Same stack: agents on your own Cloudflare account. See the overview. For the platform gaps, read the RFC.
The lessons across all four tools, and the model behind them.What I learned →