tools / tasks.py
Cron + interval background-job scheduling via APScheduler.
Tool: manage_tasks
| Action | Args | Behaviour |
|---|---|---|
create | task_name, cron_expression, prompt | Add a job: "0 9 * * *" → CronTrigger.from_crontab(); "interval:60" → add_job(..., 'interval', seconds=60). |
list | — | Returns all active jobs. |
stop | task_identifier | Remove a single job by id. |
stop_all | — | Wipe all scheduled jobs. |
The job body is the prompt that will be re-injected into the agent on the trigger schedule. APScheduler is bound to the FastAPI lifespan and shut down with wait=False so server restart doesn't block on long-running jobs.