Celery and Agency lifecycle
Celery moves work onto background workers. It is not the Agency domain lifecycle.
Not the same thing
Celery Task ≠ Execution
Celery Task ≠ Run
Concept |
Meaning |
|---|---|
Celery Task |
Transport job ( |
Execution |
Business intent (mission + agent + user) |
Run |
One technical graph attempt on a Thread |
Domain status fields live on Agency models. Flower / Celery state can disagree temporarily; trust the DB for product status.
What Celery does here
Tasks in agency.tasks (names as registered):
agency.start_mission— runAgent.executefor a dispatchagency.resume_mission—ThreadRunner.resumeafter HITL answeragency.tasks.minute— sample / ops helperollama_models_update— refresh Model rows from a provider (Ollama tags or OpenAI-compatible/models)
Host apps may add more (indexing, scrapers, scheduled jobs). Same rule: persist business outcomes on domain models when the work matters to Agency.
HITL and workers
On interrupt, the start_mission worker exits after persisting Run /
Interruption. Hours later, answering the interruption enqueues
resume_mission. No worker sits blocked in ask_human.
Behaviour note
resume_mission currently assigns execution.status = SUCCESS after
resume returns. Prefer reading Run statuses when diagnosing multi-step HITL;
see Human-in-the-Loop.
See also: Execution Runtime, autodoc Tasks.