Tasks & the agent lifecycle
The live task checklist and how a long agent run progresses.
For anything bigger than a one-shot answer, the agent works through a visible plan. The Tasks card turns a long run from a wall of streaming text into a checklist you can watch complete.
The Tasks card
When a job has multiple steps, the agent calls its update_tasks tool and a Tasks card appears in the transcript — one row per step, each with a status glyph:
- pending — not started yet,
- in progress — the row currently being worked,
- done — checked off.
The card is live: as the agent progresses it re-posts the full list and Mel updates the glyphs in place. Each newly finished step also prints a transcript line — ✓ Completed <task> (n/m) — so consecutive completions read 1/3, 2/3, 3/3. The input footer gains a ☰ n/m progress chip that counts up alongside.
The ordering matters, and it's deliberate: the agent reads and understands first, then writes the task list, then executes. You'll typically see a file read and a short diagnosis before the checklist appears — the plan is grounded in the code, not guessed from the prompt.
Anatomy of a long run
A substantial turn interleaves, in order:
- Thinking (the collapsible Thoughts section) and short narration.
- Read-side tool calls —
read_file,grep,list_dir— to build context. - The Tasks card.
- Execution: edits (each gated by an approval card unless autonomous) with diff cards, commands with live output.
- Live check-offs as steps land.
- A final answer plus the expandable usage summary.
How long can a run go?
A single turn can span up to 80 tool round-trips — enough for the agent to scaffold a project, install dependencies, build, hit an error, fix it, and build again, all from one prompt. Individual commands get up to 10 minutes, so real npm install or cargo build runs finish rather than timing out.
In-run compaction
Long runs generate a lot of tool output, and context windows are finite. Mel manages this automatically inside the run:
- Each tool result is capped (about 16 KB) with the middle elided, keeping the informative head and tail.
- When the accumulated context approaches budget, older tool results are compacted in place — no extra model call, no pause — so the run keeps going instead of hitting the window.
This is separate from conversation-level compaction between turns, which is covered in Conversation management.
While it runs
The input stays live during a run — you can keep typing. To stop a run, use the stop button that replaces send while a turn is streaming. If the agent needs a decision (an approval, or a spawn confirmation during orchestration), the run blocks on the card until you answer — and Mel's notification bell flags blocked or completed agents in tabs you're not looking at.