GET /task/{task_id} reports where a task is:
Knowing when a task is done
This is the one piece of Autumn that reliably trips people up, so it is worth stating
precisely.
A finished task returns to status: "plan" with activity: "idle". But plan is also
the state a task sits in before it executes. So status alone cannot tell you a task
is done. Read on its own, it will tell you a task that has not started yet is finished.
A task is still working while any of these hold:
phase is execute
status is execute or running
activity is executing, running, planning, or thinking
It has stopped when none of those hold, or when status/activity is deleted, or
error is out_of_credits/error.
Include the deleted and error cases in your poll loop. A loop that waits only for
status: "plan" with activity: "idle" never exits on a task that was deleted or ran out
of credits. It spins forever on a task that is never coming back.
A correct poll loop
Prefer live events over polling? See Live messages.
After a task finishes
A task_id stays valid once a turn ends. Read status and output any time, and use
POST /task/{task_id}/continue to start another turn on the same task. Stopping a running
task with POST /task/{task_id}/stop also returns it to plan.