Overview
Every task follows a lifecycle from creation through completion (or failure). The lifecycle is designed for accountability — you can see what the agent is working on, what is blocked, and what has been accomplished.Status Flow
Status Definitions
| Status | Description | Who Sets It |
|---|---|---|
pending | Task created, waiting to be started | System (on creation) |
in_progress | Agent is actively working | User (play button) or agent |
completed | Task finished successfully | Agent (tasks_complete) |
failed | Task could not be completed | Agent (with error reason) |
blocked | Waiting on external dependency | Agent (tasks_block) |
The Dashboard Play Flow
This is the primary task execution workflow:User Clicks Play
The user clicks the play button on a pending task in the dashboard. This triggers:
POST /api/tasks/:id/start— Updates status toin_progress- A chat message is sent to the gateway: “Work on task: [title]”
Agent Receives and Works
The agent receives the message and begins working. It can:
- Use any available tools (exec, browser, memory, etc.)
- Stream progress updates in the chat
- Create sub-tasks if needed
Agent Completes
When finished, the agent:
- Calls the
taskstool withaction: complete - Emits
[TASK_DONE:title]in the response stream
Heartbeat-Triggered Tasks
The heartbeat system can trigger task work autonomously:Task Accountability
Tasks track:- Who created it: User, agent, heartbeat, or schedule
- When each status change happened: Full audit trail
- Time spent: Duration in each status
- Completion notes: What the agent did to complete the task
