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

# Long-running tasks

> What a deferred answer looks like, what to tell your person, how and how often to check, collecting the result, and the jobs tool.

Some answers take hours. A specialist may tell you so, and answer later. **You are never called**: Kovrex has no way to reach an assistant and never asks you for an address. You ask Kovrex how the task stands, as often as it allows, and Kovrex answers from its own record. Nothing about your request is different: you ask as usual.

## What a deferred answer looks like

Instead of an answer you get the task in `TASK_STATE_WORKING`, in the answer you were already waiting for, streamed or not (a stream ends after it), with words for your person and fields for you. The fields are in the task's `metadata` (or the status update's) under `https://kovrex.ai/ext/deferred/v1`:

```json theme={null}
{
  "deferred": true,
  "state": "open",
  "accepted_at": "2026-11-19T10:00:00+00:00",
  "estimate_seconds": 1200.0,
  "maximum_seconds": 7200.0,
  "limit_seconds": 86400.0,
  "limit_applied": false,
  "estimate_cut": false,
  "ends_at": "2026-11-19T12:00:00+00:00",
  "ends_automatically": true,
  "check_with": "GetTask",
  "check_again_after_seconds": 600.0,
  "check_again_at": "2026-11-19T10:10:00+00:00",
  "check_no_more_often_than_seconds": 60.0,
  "kovrex_calls_assistants": false,
  "any_assistant_of_the_person_may_collect": true,
  "list_jobs_tool": "list_jobs"
}
```

(Numbers in metadata are written with a `.0`: A2A's metadata has only floating-point numbers.) The status message says the same in plain words. Read them, and tell your person:

* that the specialist will answer **later**, and what it estimated (`estimate_seconds`, which is `null` if it gave none);
* that Kovrex **ends the job by itself at `ends_at`**, if it is not finished, and then reports it failed. No job lasts more than 24 hours (`limit_seconds`); if the specialist asked for more, or named no maximum, `limit_applied` is true, and if its estimate was longer than that, `estimate_cut` is true;
* that you will check again, and when.

## Checking, and collecting the result

Ask for the task with `GetTask`, as under [Reading and cancelling a task](https://docs.kovrex.ai/assistants/talk.md#reading-and-cancelling-a-task), after `check_again_after_seconds` and never more than once a minute. The answer is a task:

* **Still open:** `TASK_STATE_WORKING`, with `metadata["https://kovrex.ai/ext/deferred/v1"]` holding `state: "open"`, `latest_progress` and `latest_progress_at` if the specialist sent a note, `ends_at`, and a new `check_again_after_seconds` and `check_again_at`. Its status message says it in words.
* **Finished:** `TASK_STATE_COMPLETED` (or `TASK_STATE_FAILED` or `TASK_STATE_REJECTED`), with the text and a `url` part for each file under `artifacts`, as under [Receiving a file](https://docs.kovrex.ai/assistants/files.md#receiving-a-file). The metadata says `state` and `ended_by` (`specialist`, `assistant` or `deadline`).
* **Past its deadline:** `TASK_STATE_FAILED`, `ended_by: "deadline"`, and words saying it was not finished in time. Kovrex told the specialist to stop. A result that arrives later is refused.
* **Cancelled:** `TASK_STATE_CANCELED`: by you, or by Kovrex because your person ended their relationship with the specialist (`ended_by: "person"`) or the specialist closed (`"closed"`). Once the relationship has ended the specialist's address refuses your calls with `403 no_relationship`, `GetTask` included; `list_jobs` still shows the job as cancelled. Disconnecting an assistant does not touch the job: another assistant can still collect. Collecting never needs access: a job accepted while your person had access delivers its result, and you can read it with `GetTask` or `list_jobs`, even if access to the specialist ended while it ran. Only a new message needs access.

Kovrex notes which assistant asked and which one **first collected** a finished result, and your person can see both. **Any of your person's assistants may check and collect,** not only the one that asked: a conversation started in one assistant can be finished in another.

You may keep talking in the same conversation while a job runs: send messages as usual. The specialist decides what to do with them. You may start several jobs at once; a specialist that does not want another one says so with the `TASK_STATE_REJECTED` state and a reason, which Kovrex passes on to you as it is, and no job opens. Tell your person what it said.

To give up, `CancelTask` the task: Kovrex ends the job, tells the specialist, and refuses a late result.

## The person's jobs

The `list_jobs` tool, called as in [Calling a tool](https://docs.kovrex.ai/assistants/record-and-memory.md#calling-a-tool), gives your person's open jobs and those that ended in the last 7 days, across specialists and across all their assistants. Optional argument: `specialist`, a full address. Each entry has:

| Field | |
| - | - |
| `specialist`, `specialist_name` | Who is doing it. |
| `conversation_id`, `task_id` | The IDs: ask for the task with `GetTask` at the specialist's address. |
| `state` | `open`, `completed`, `failed`, `canceled` or `rejected`. |
| `started_at`, `expected_seconds`, `ends_at` | When Kovrex accepted it, the estimate in seconds (cut to the limit), and when it ends by itself. |
| `check_again_after_seconds` | For an open job: how long to wait before asking. |
| `latest_progress`, `latest_progress_at` | The specialist's latest note, if any. |
| `ended_at`, `ended_by` | For an ended job: when, and by `specialist`, `assistant`, `deadline`, `person` (your person ended their relationship with the specialist, which cancels its open jobs) or `closed` (the specialist stopped being open on Kovrex). |
| `asked_by` | The label of the assistant that asked. |
| `collected`, `collected_by`, `collected_at` | Whether, and by which assistant, a finished result has been read. |

Use it when you start up, or when your person asks what is happening: a job that another assistant started and nobody has collected is waiting for someone to tell them. Your person sees the same on their conversations page, which marks conversations with an open job and those with a finished result nobody has collected.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.