> ## Documentation Index
> Fetch the complete documentation index at: https://docs.argentos.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Task Management UI

> Creating tasks, tracking progress, and the play/complete workflow in the dashboard.

## Overview

The dashboard's task management interface gives you a visual way to create, track, and manage tasks that your agent works on. Tasks are stored in a shared SQLite database (`~/.argentos/data/dashboard.db`) that both the dashboard and the agent's tools access.

## Task List View

The task list shows all tasks with:

* **Title**: What the task is about
* **Status**: pending, in\_progress, completed, failed, blocked
* **Priority**: urgent, high, normal, low, background
* **Source**: Who created it (user, agent, heartbeat, schedule)
* **Created/Updated**: Timestamps

## Creating Tasks

<Tabs>
  <Tab title="From the Dashboard">
    Click the **+ New Task** button and fill in:

    * Title (required)
    * Description (optional)
    * Priority (defaults to normal)
  </Tab>

  <Tab title="From Chat">
    Tell the agent to create a task:

    ```
    Create a task to review the Q4 security audit
    ```

    The agent uses the `tasks_add` tool and the task appears in the dashboard immediately.
  </Tab>

  <Tab title="Via Slash Command">
    ```
    /task Review the Q4 security audit
    ```
  </Tab>
</Tabs>

## The Play/Complete Flow

This is the core task workflow:

<Steps>
  <Step title="Start a Task">
    Click the **play button** on a task. This:

    * Calls `POST /api/tasks/:id/start` to update the status
    * Sends a chat message to the gateway telling the agent to work on this task
    * The task status changes to `in_progress`
  </Step>

  <Step title="Agent Works">
    The agent receives the message and begins working. It may:

    * Use tools (exec, browser, memory) to complete the task
    * Stream progress updates back through the chat
    * Call `tasks_complete` when finished
  </Step>

  <Step title="Completion">
    When the agent finishes, it:

    * Calls the `tasks` tool with `action: complete`
    * Emits a `[TASK_DONE:title]` marker in the response stream

    The dashboard detects the marker for instant UI updates and also polls the database every 5 seconds as a backup.
  </Step>
</Steps>

## Task Status Flow

```mermaid theme={null}
graph LR
    P[pending] --> IP[in_progress]
    IP --> C[completed]
    IP --> F[failed]
    IP --> B[blocked]
    B --> IP2[in_progress]
    IP2 --> C2[completed]
```

| Status        | Description                           |
| ------------- | ------------------------------------- |
| `pending`     | Created but not started               |
| `in_progress` | Agent is actively working on it       |
| `completed`   | Task finished successfully            |
| `failed`      | Task could not be completed           |
| `blocked`     | Task is waiting on something external |

## Real-Time Updates

The dashboard updates task status through two mechanisms:

1. **Stream markers**: `[TASK_DONE:title]` parsed from the agent's response stream for instant feedback
2. **Database polling**: Every 5 seconds, the dashboard polls the database to catch any changes made directly by the agent

<Tip>
  This dual approach ensures the UI stays current even if a marker is missed.
</Tip>
