Does cost_drift work for a scheduled agent that has no user sessions?

Yes. cost_drift was never built around sessions in the first place: it tracks dollars per turn at the call site, and a scheduled job’s runs are turns like any other, whether or not a person is on the other end.

The baseline builds from that call site’s own history regardless of what triggers it, a user message, a cron job, a queue worker. What it needs is enough turns to know what normal looks like, not a particular traffic pattern. A call site that only runs a handful of times a day will take longer to build a baseline worth trusting than one running continuously, but it isn’t blocked by having no sessions to count.

If you’re watching a scheduled agent, the useful comparison is the same one you’d use for any call site: cost per turn against its own past, not spend against the calendar.

keep reading

More on this.

Send us the traces you already emit.