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

# Task delegation

> See why an agent hands long work to background Tasks, what you see while they run, and how the agent and its Tasks work together.

An agent in a Room answers one message at a time. A long job, such as researching rivals or drafting a deck, would hold the chat until it finished, and your next question would wait behind it.

A **Task** moves that job into the background. The agent in your chat, its Meta, hands the job to a background copy of itself, an AlterEgo, and stays free to talk. Each Task has its own AlterEgo, so several jobs can run at once.

This works like a lead who hands a job to an assistant and stays in the meeting. The comparison stops at one point: an AlterEgo is a copy of the same agent, not a different agent.

This page shows what you see while Tasks run, how the Meta and its AlterEgos work together, how the agent keeps you posted on long work, and how a new request reaches a running Task.

![You ask for rival research and then a deck; the Meta starts one Task for each and keeps replying, a follow-up about the logo joins the deck Task, and each Task's report becomes a card in the chat.](https://mintcdn.com/lev9-doc/5pdfMti1SxmkV9YT/images/feature-task-timeline.gif?s=a41d174b904e6bf1483bf5abfad4cc77)

Two Tasks run side by side while the chat goes on.

## What do you see while a Task runs?

The agent keeps talking, a line above the message box counts its running Tasks, and each result arrives as a card.

* **A short reply.** The agent says in a line that the work is under way, then answers your next message as usual.
* **The background line.** Above the message box, a line reads "2 tasks running in the background". Open it to see each Task's name and how long it has run. The line disappears when no Task is running.
* **A progress update.** When a Task runs long and the agent goes quiet, the agent posts a short update on its own. See [how the agent keeps you posted](#how-does-the-agent-keep-you-posted-on-a-long-task).
* **Approval cards.** A Task that needs your approval, for example before it sends mail, posts a card and waits. The card appears in the Room, or in your direct chat with the agent when you are not in that Room. A card that nobody answers expires after 10 minutes. See [Approvals and permission review](https://docs.heylinger.com/security/approvals.md).
* **The result.** When a Task finishes, the agent posts a card with a short summary and the files. When a Task fails or needs your decision, the agent tells you in a message instead.

You manage a Task by talking to the agent: add to it, ask how it is going, or ask it to stop. Each agent runs up to 10 Tasks at once across all its Rooms, and a Task that waits for your approval does not count.

## How do the Meta and the AlterEgo work together?

The Meta owns the conversation, and each AlterEgo owns one job. They hand work to each other through the server, never through your chat.

1. **Start.** The Meta runs `teamhub task create` with a name and a brief. The AlterEgo starts in its own session and workspace on the same computer. It never sees the chat, so the brief must carry everything it needs.
2. **Work.** The AlterEgo works in the background. It cannot post in the Room or ask you anything, because Linger blocks those commands inside a Task. A question goes into its report instead.
3. **Report.** When a turn ends, its last reply goes privately to the Meta as a report. No one else sees it. When the turn fails, the Meta gets the error.
4. **Deliver.** The Meta reads the Task's files and decides what the Room needs: a card with the result, a question for you, or nothing.

The two workspaces share exactly one folder. The AlterEgo writes its outputs into `playground/<task-id>/`, and the same folder appears in the Meta's workspace, so the Meta can read the outputs while the Task still runs.

![On one computer, the AlterEgo workspace holds playground/\<task-id>/, a CLI config that sends every command to its Task, its own packages, and read-only agent memory and Skills, and it receives follow-ups in a private Inbox; the Meta workspace links the same playground/\<task-id>/ folder and reads it live.](https://mintcdn.com/lev9-doc/5pdfMti1SxmkV9YT/images/feature-task-workspace.png?fit=max\&auto=format\&n=5pdfMti1SxmkV9YT\&q=85\&s=565f48be748e4a73f93d540634bc0f3b)

The AlterEgo shares one folder with the Meta; the rest of its workspace is its own.

Every `teamhub` command that the AlterEgo runs goes to its own Task, because `.teamhub/cli/config.json` in its workspace names that Task. Follow-ups from the Meta and the answers to its approval cards reach it through a private Inbox, not through files.

[Agent memory](https://docs.heylinger.com/knowledge/memory.md) learns from the Meta's conversation. A report enters that conversation, so what a report says can become memory. The steps inside a Task do not.

## How does the agent keep you posted on a long Task?

Linger watches the quiet time between reports. A report wakes the Meta as soon as a turn ends, but one turn can run for a long while, and the chat would hear nothing.

1. **Linger notices the silence.** A Task of this Room is running or waiting for an approval, and the agent has said nothing in the Room for 10 minutes.
2. **Linger reminds the Meta in private.** The reminder lists each Task with how long it has run, when it last reported, any approvals it waits for, and its latest step.
3. **The Meta decides.** When something is worth telling you, it checks the Task with `teamhub task check` and posts one short update in its own words. When nothing that matters has changed, it says nothing.

A reminder that leads to silence doubles the next wait: 20 minutes, then 40, up to 2 hours. Any change resets the wait to 10 minutes, whether the agent speaks or the Task reports, takes a new step, or asks for an approval. Linger sends no reminder while the agent is in the middle of a reply, and none while a voice call handles the work.

You never see the reminder itself, only the update that the agent chooses to post.

## How does a new request reach a running Task?

You tell the Meta, and the Meta passes your request to the same Task with `teamhub task send`. It does not start a second Task for the same work.

| The Task is | What happens to your request |
| - | - |
| Running | It joins the turn in progress when the Runtime can take it. Otherwise it runs as the next turn. |
| Idle, failed, or stopped | It starts a new turn. The Task keeps its files and session. |

When you ask how a Task is going, the Meta checks it with `teamhub task check` and tells you how it really stands. When you ask it to stop, `teamhub task stop` ends the current turn and keeps the files, so a later request can pick the work up again.

Your answer on an approval card goes straight to the AlterEgo. The Meta does not relay it.

## Keep learning

> [card] [Approvals and permission review](https://docs.heylinger.com/security/approvals.md)
>
> See which actions wait for your card.

> [card] [Agents, Rooms, and Contexts](https://docs.heylinger.com/concepts/agents-rooms-contexts.md)
>
> See how one agent works in many Rooms.

> [card] [Agent memory](https://docs.heylinger.com/knowledge/memory.md)
>
> See what an agent remembers across Rooms.

> [card] [Build a team with team.md](https://docs.heylinger.com/rooms/team-md.md)
>
> Split a job across several agents instead of one.


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