How Rusuban uses Sprites
Two Sprites in your Fly.io account, one that can act and one that can only think, sleeping when idle, with every key held by Sprites connectors.
A Sprite is a small Linux computer on Fly.io that keeps its disk, sleeps when nothing is happening and wakes in a second or two when a request arrives. Rusuban is built around that: an agent that is always there, costs nothing while asleep, and never loses its database.
2
Sprites per install: the agent and the workshop
304
wakes in 7 days on the developer’s agent
5 min
between signed QStash ticks
0
provider API keys on either Sprite
What runs where
| Sprite | Runs | Can reach |
|---|---|---|
rusuban-agent | the agent service on port 8080: the HTTP API, the worker, SQLite on its own disk | every connector labelled for it: your accounts, the AI service, Jev, Pinecone, Box, calls, browser, mail |
rusuban-workshop | the code-task and mini-app runner (Codex or Claude Code) | an outbound allowlist: the Sprites gateway (the AI service's connector only), npm, and OpenAI and ChatGPT for Codex. No GitHub, mail or anything that sends |
The Sprites features it uses
| Feature | How Rusuban uses it |
|---|---|
| Sleep and wake | The agent sleeps between requests. A QStash tick every 5 minutes, any app request, or the live view wakes it. |
| Public URL | The agent's *.sprites.app URL is public so phones, webhooks and the live view can reach it; every write needs a device token. The workshop's URL is public too, and refuses any request the agent didn't sign. |
| Services | Both run as Sprite services (sprite-env services), so they start on every wake and survive the session that created them. |
| Tasks API leases | Any unit of work holds a lease through the Sprite's local socket (5-minute expiry, renewed every minute), so the Sprite stays awake while it works; a send cut short anyway becomes May have run. A send waiting out its undo window holds one too. |
| Checkpoints | Every deploy saves one, Save one now saves one, and Rewind restores one with sprite-env checkpoints restore. |
| Connectors | Every key lives in a Sprites connector; the agent finds them through the gateway list and calls them with a placeholder key. Connectors. |
| Labels | Each connector's access policy names the Sprites' labels, so only your Rusuban Sprites can use it. |
| Network policy | The workshop's outbound traffic is limited to an allowlist the installer sets and reads back before it starts the service. |
| CLI | The installer creates the Sprites, pushes code (sprite file push), installs Linux builds of dependencies (sprite exec) and sets up connectors (sprite api). |
Waking on time
Sprites have no scheduler of their own, so one Upstash QStash schedule posts to /hooks/tick every 5 minutes with retries off. The agent verifies the signature, answers 202 at once, and then runs whatever is due: checks, routines, chases, reminders, the brief. Everything due is a row in its database with a time in your time zone, so changing the brief time needs no change at Upstash.
If you skip QStash, the agent still works whenever you open the app; scheduled work then runs on the next request.
After a restart
When a Sprite comes back, the agent first checks for a Rewind manifest (sending nothing until it's done), then repairs anything a restart cut short: a run in progress is marked interrupted and answered again, a send that was in flight becomes May have run, and timers that were claimed are released.