Ir al contenido
#0551
AgentSqliteNotifications

The babysitter retires when the backlog hits zero

A customer kicks off a 400,000-row import at 6pm. Some rows will be malformed. You won't be watching.

You create a loop on the agent session: interval 15m, a prompt that reads the import queue from hoody-sqlite, retries transient failures, and quarantines rows that failed twice. The loop carries a stop predicate evaluated every run: stop when pending reaches zero: plus a cost ceiling and a wall-clock ceiling so a stuck row can't keep it alive forever.

At 2:40am the queue empties. The predicate trips, the loop stops itself, and the agent posts one notification: import complete, 31 rows quarantined. Tokens went through the Gateway from the AI Balance, capped where you capped them.

No worker service, no polling script, no alarm. The loop doesn't run until morning; it runs until the job is done.

The loop doesn't run until morning; it runs until the job is done.