Scheduler
Scheduled and recurring agent runs: the agent can schedule_task a prompt for later (once, or every N minutes), list_scheduled_tasks and cancel_scheduled_task. Runs happen in the background on WorkManager (ScheduledAgentWorker), survive reboots, and post their answer as a notification (if the app may post notifications).
Background runs have nobody to approve tools, so tools that require approval are denied there. Scheduling itself requires the user's approval. The app's Application must implement ScheduledAgentHost.
Properties
Functions
Link copied to clipboard
fun schedule(title: String, prompt: String, firstRunAt: Instant, everyMinutes: Int? = null): ScheduledTask
Schedule prompt at firstRunAt, repeating every everyMinutes (≥ 15) when given.