Shell
Use a trap so failures report even when the job exits early:Python SDK
Add@monitor() to a synchronous or asynchronous scheduled function. The SDK reads STILL200_PING_TOKEN from the environment and reports the complete run lifecycle.
perform_work() raises, the SDK reports the exception message and then re-raises the original exception so your scheduler still sees the failure.
AI agent loops
A scheduled agent — one that triages new tickets every 15 minutes, or summarizes the day’s errors each night — fails in the same quiet ways as any cron job, plus a few of its own:- It never starts, because the scheduler, container, or credentials broke.
- It errors out: a provider outage, a rate limit, or a tool call that raised.
- It never finishes, stuck retrying a tool or looping without converging.
load_pending_work and agent_step stand in for your agent framework — the monitoring pattern is the same whatever you build the agent with.
When you create the monitor:
- Set the cron expression to the agent’s schedule, for example
*/15 * * * *. Occurrences must be at least five minutes apart, so agents that loop continuously or pick their own next run need a fixed cadence to be monitored. - Set a maximum runtime a little above the agent’s longest normal run. A step limit only helps while your code is still running; the maximum runtime catches the run that hangs outright, such as a tool call that never returns.