# Task blocks

1. Opening sentence, outside any block
2. Finished block, one line: name, result, 5 steps, 4 min
3. Text between two tasks
4. Running block, open: header 1/3, purpose under the name; one indent in, the three steps; the first, opened by a click, shows its tool row one indent further in
5. Final answer, outside any block

A task block is one named stretch of work inside a reply. The agent says where each tool call stands in the task with that call's `task_progress` argument, so reporting progress costs no model round trip; the runtime decides which work belongs to it and closes it when the reply ends.

## Parts

| Part | Rule |
| --- | --- |
| Shape | A passage in the reply column. No bordered card. State is drawn on the header's status glyph. |
| Levels | Three, marked by indentation alone, one unit apart: the header; the steps; a step's work. The unit is the header's glyph and its gap, so each level's nodes sit under the text of the level above. Size and weight do not mark a level: the name, its one-line purpose, every step and a step's note are set in one size, the size of the tool group summary, the step in progress included. |
| Header | Status glyph, task name, progress, elapsed time, the +N −M pill, chevron. Same 28px row and type as the tool group summary. Running, progress is the place of the step in progress (3/5: on the third); stopped or carried, the steps finished. Hidden when the task has no steps or ended without advancing. |
| Narrow column | The name is cut last: the result and the current step shorten first, and under 480px the time and the pill leave the header. |
| Purpose | One muted line under the name saying what the block is for |
| Steps | One indent in, one row per step, the nodes on one rail that runs from the first step to the last. State is the node and the text colour. Done: check, title, a muted half-sentence result. Current: sweep and a present-tense summary. Waiting: hollow circle. Dropped: struck through, not counted. |
| A step's work | Folded until the reader clicks the step, the step in progress included; a second click folds it. Then the existing step rows (tool calls, thinking, sub-agent rows) and the text said during that step, one more indent in, with no rail of their own. Normal, Thinking and Verbose apply here. |
| No steps | A name alone opens a block; the work lies flat under it. A task that ended without one advance is drawn the same way, its steps as outline only: no step is ticked for it and no N/N is shown. While it runs it is on its first step and the work is that step's. |
| Outside the block | The sentence before work starts, text between two tasks, and the final answer. Always visible. |
| Small work | No block. The reply looks as it does without a task: summary lines and text. |

## States

| Case | Drawn as |
| --- | --- |
| Running | Open to the name, purpose and steps; every step one row, its work folded |
| Running, folded by hand | One row: name, current step, 3/5, time |
| Finished | Folds in place to one row: name, result, step count, diff, time. Without a written result, the deterministic summary; never guessed from the text. |
| Stopped, failed, interrupted | Stays open with the existing Stopped, Interrupted or failure tag and 3/5. The step it was on carries the state on its node; waiting steps stay waiting. The tag is on the block alone: nothing after it in the reply is tagged again. The time runs to the end of the reply, and is left out when that is not known. |
| Waiting on the person | Still running: open, no tag. The glyph and the name stop moving until the reply goes on. |
| Continued after a stop | A segment with the same name in the new reply, from the first `task_step` call there |
| Second task in one reply | The earlier block folds. One that was not finished reads "stopped at 3/5", not a check, and its open steps are dropped. |
| Goal over several turns | A task spans turns. Each reply draws its own segment; steps finished in earlier turns are one row, "5 earlier steps done", which jumps to them. |
| Sub-agent | Its existing row sits under the step that sent it. The block stays open while it runs. Its own task blocks show only in its conversation. A task it starts belongs to that one run: two runs of the same agent never share a task. |
| Reopened conversation | Ownership is derived from where the stored calls sit, the same as live |
| Conversation stored with todo lists | A list is one folded block named Todos, with its count, at the first todo call of the first loaded reply that has it. A list that cannot be placed stays as "updated todos" in the summary line. Nothing is rewritten. |
| After compaction | The open task (title, steps, current step) is given to the model again |
| Opened or folded by hand | A block: wins over its automatic opening and folding. A step: the only way it opens; it stays as chosen while work streams in and after the step finishes. Both are remembered per reply in this browser, for the latest 500 choices. Enter and Space toggle; Left folds, Right opens. |

## Tools

One argument on every call, two tools for what it cannot say. A task is one list in the todo store and a step is one todo, so Goal verification and a sub-agent ticking its parent's step read the same data.

| Tool | Contract |
| --- | --- |
| `task_progress` (`task?, steps?, step?, result?`) | An optional argument of every tool the model can call, MCP tools included, when the turn offers the task tools. It says where the call stands: `step` is the number of the step the call works on. A `task` no open task has as its title opens one with `steps`. When `step` changes, the step in progress is finished, `result` left on it. Sent again unchanged, it changes nothing. A step past the last keeps the last one going. |
| `task_start` (`title, purpose?, steps?`) | Title is a noun phrase of at most 40 characters; purpose is one sentence; steps are 1 to 7 short phrases, written at once. The first step starts. An open block is closed first. |
| `task_step` (`next?, step?, add?, drop?, result?, outcome?`) | `next` finishes the current step and starts the following one, without an id. `step` jumps out of order. `add` appends, `drop` marks dropped. `result` leaves a half sentence on the step just finished. `outcome` ends the task with its result; steps still open are dropped. With no open task it returns a hint, not an error. A sub-agent with no task of its own ticks step N of the task it was sent from with `step=N`. |
| `task_list` | Read-only: the tasks and their steps. Loaded on demand, not always present. |
| Who is sent what | `task_start` is resident: its description carries the rules. `task_step` is loaded on demand, for a purpose, added or dropped steps and an outcome. The loader, the task tools and the structured-output submit tool take no `task_progress`; a tool whose own schema has a property of that name keeps its own. |
| Rules in the description | Progress rides on real calls, never a response of its own; no last call to close a task. The plan is not repeated in the text. A task is for three steps or a dozen calls; a reply holds none, one or two. When redirected, drop the steps or start a task. |
| Result | A task tool's result is one line on where the task stands. A real call's result is its own; a sentence is added only when its `task_progress` could not be applied. |

## What the runtime decides

| Rule | Reason |
| --- | --- |
| Ownership is by position | A reply's blocks are read in order. A task call, or a call whose `task_progress` moved the task, is a boundary: it and every block after it belong to the task and step it set. Each text, thinking and tool block is stamped `task` and `step`. The stored blocks give the same answer while streaming, when finished and when read back. |
| A block ends at its last real call | Stamped text after the task's last tool call that is not a task call is drawn outside. The text between two tasks and the final answer stay visible without the model marking them. While the segment is not closed, thinking after that call is the step's work too, so a step's work is inside it from the start and a stop leaves no second row under the block. |
| Progress is applied before the call runs | The dispatcher takes `task_progress` out of the arguments before they are checked, applies it, and only then runs the call, so the call's card is under its step from the start and the tool, an MCP server or a plugin never sees the argument. The card and history keep the call as the model wrote it, so later requests send the same bytes. |
| Applied once | A call dispatched again after a pause is applied once: its occurrence (the response, its place in it and its id) is kept on the task, not the bare id, because Gemini gives the calls of every response the same ids. |
| Progress never moves back | A step already finished or dropped is never taken up again: a parallel call written for the step before, run after the call that moved on, leaves the task where it is. |
| The argument is added where the tools array is built | One place adds it to each tool sent, the same every request, so the cached prefix holds. Strict providers get it as one more nullable property. A tool's own definition and its load record are left alone. |
| A reply starts in no task | Except a turn of the Goal the open task was started under: it continues that task from its first block, and its segment begins at its first real call. |
| A normal end closes | The step in progress is finished only when that closes the task: advanced, no step waiting, under no Goal. A Goal's turn ends whenever the model stops calling tools, so its step stays in progress. Nothing left: the task is done. Never advanced and under no Goal: done, no step ticked. Otherwise it stays open, the step still in progress, and the segment is carried to the next turn. |
| A sub-agent's run closes its own task | The task is keyed by the run's reply. A run has no next turn: at its normal end a task with steps left is closed as displaced, its open steps dropped, none ticked. |
| A stop, a pause or a failure closes nothing | The segment still says running; the reply's own status draws it Stopped, Failed or Interrupted. No second copy of that state exists to disagree with the reply. |
| A displaced task drops its open steps | Its step in progress is finished first when that closes it, by the rule of a normal end. A Goal would otherwise wait for steps nobody will tick. The segment keeps the steps as they stood, and Goal acceptance still lists dropped steps to the verifier. |
| A segment may arrive after its blocks | A block whose task has no segment yet is drawn as outside any task, and joins when the segment arrives. |

## Elsewhere in the interface

| Place | Rule |
| --- | --- |
| Under a reply | Nothing: a task shows only as its block |
| Tool group summary | Task calls give no phrase; a line holding only task calls is not drawn |
| Goal chip | Reads "current step · 3/5": the place of the step in progress, as in the block's header. A click scrolls to the open block and opens it only when the reader had folded it, so a block open by itself still folds when the task ends. With the block already in view, or not on the page, the click opens the Goal's details, which have no other entry. Dropped steps leave the total. |
| Jump from the chip | The chip sits outside the scroll area, so the jump tells the area the reader is moving. A view parked at the latest is otherwise pulled back on the first frame. |
| Activity panel | No task group |
| Message rail | A turn with a task has a 14px tick; its preview lists the task titles with their step range, and a click goes to that block. Under the titles is the answer after the last call, not text said inside a step. A conversation with one message shows the rail once its replies hold two task blocks, as a Goal does. |
| Terminal | No nesting: a task call draws the title, 3/5 and the steps under its own line |
| Channels | The task tools are not offered; text is sent as written |

## Why

| Harness | Plan or task tool | Where the list shows | Source |
| --- | --- | --- | --- |
| Claude Code | `TaskCreate`, `TaskUpdate`; `TodoWrite` before them, a call of its own carrying the whole list. Present by default only on Opus 4.7, Sonnet 4.6, Haiku 4.5 and earlier; left out on other models unless opted in. | A task list view outside the transcript, toggled with Ctrl+T, five tasks at a time; kept across compaction | [Tools reference](https://code.claude.com/docs/en/tools-reference#task-tool-availability), [Task list](https://code.claude.com/docs/en/interactive-mode#task-list) |
| Codex CLI | `update_plan`: a call of its own with an optional explanation and the whole list of steps with a status each; at most one in progress; the result is only "Plan updated"; refused in Plan mode | Not verified | [plan_spec.rs](https://github.com/openai/codex/blob/main/codex-rs/core/src/tools/handlers/plan_spec.rs), [plan.rs](https://github.com/openai/codex/blob/main/codex-rs/core/src/tools/handlers/plan.rs) |
| OpenCode | The built-in tools page lists no todo tool | Not verified | [Tools](https://opencode.ai/docs/tools/) |
| Hermes Agent | `todo_list`, for tasks of three steps or more; an item can name a parent and become a subtask | The tree, indented | [Tools reference](https://hermes-agent.nousresearch.com/docs/reference/tools-reference) |
| GitHub Copilot CLI | Plan mode writes an implementation plan before any code; no progress list is documented | Not documented | [About Copilot CLI](https://docs.github.com/en/copilot/concepts/agents/copilot-cli/about-copilot-cli) |
| Pi | Ships without plan mode and sub-agents; such features come from packages | None built in | [README](https://github.com/badlogic/pi-mono/blob/main/packages/coding-agent/README.md) |
| mini-SWE-agent | Bash only, linear history | None | [README](https://github.com/SWE-agent/mini-swe-agent/blob/main/README.md) |
| Cline | In v3.30, every tool took an optional `task_progress` parameter holding the whole checklist, to be updated regularly. The current source keeps it only to read old tasks, and the Focus Chain built on it is listed as deprecated. | A checklist in the chat | [task_progress.ts](https://github.com/cline/cline/blob/v3.30.0/src/core/prompts/system-prompt/components/task_progress.ts) (v3.30.0), [Deprecations](https://docs.cline.bot/resources/deprecations) |

Not examined: Oh My Pi, ZCode, KimiCode, Alma, MiniMax Code, Maka, DeepSeek Harness, Grok Build, Exo, Antigravity CLI. The set is the one on frontierharness.org/live.

| Decision | Reason |
| --- | --- |
| Work hangs under its step | No harness above ties the calls to the step they serve; a list beside the transcript says what is planned, not what was done for it. A finished list under a reply has nothing left to say and is never read again. |
| A block per task, folded in place | A long reply stays a few lines; each line still opens to everything behind it |
| Steps fold until clicked | The reader follows a task by its steps, the goals the agent set; the calls behind a step are read only when something needs checking. A step open by itself fills the block with searches and reads and pushes the remaining steps out of view. |
| Indentation marks the level | A step whose node sits under the name's node reads as a second task, and a bolder or larger step reads as a heading. One indent per level, as Hermes Agent draws its subtasks, is a tree at a glance and needs no type of its own. |
| The tool is kept | Claude Code leaves its task tools out on newer models and Pi ships none. Here a Goal continues over turns from this data, so it stays, with a contract small enough to cost little. |
| Progress rides on the real call | Claude Code and Codex report progress with a call of its own. On `openai-codex/gpt-6-luna` such a call goes out alone whatever the description says, so each costs a model round trip (table below). Cline put the checklist on every tool call; that is the shape kept here, as one optional argument the runtime takes out before the tool runs. |
| The argument is a state, not a change | Given `{start}` and `{next}` changes, the model sent the opening change again on every call and never moved on, so every block stayed on its first step. Given the step number, it repeats the state on each call, and a repeated state changes nothing. |
| No call to close a task | The end of the reply closes it, and a new task closes the one before, both finishing the last step only when no step waits. No step is marked done mid-reply on a guess. A finished block without a written result shows the deterministic summary, never one taken from the answer. |
| `task_step` is loaded on demand | Resident, it was still sent alone in half the replies, beside the same step change in `task_progress`. What only it can do (drop steps, an outcome) is rare. |
| Steps written at once | Codex's `update_plan` carries the whole plan in a call; with one item per call the model planned one step at a time |
| Runtime closes the block | A model that forgets the last tick leaves no half-finished block after a normal end |
| No bordered card | State is drawn on the glyph, not on a frame, as for graph nodes; several framed boxes in one reply read as separate windows |

Six runs each of one four-to-five-step task (run the tests, fix two bugs, add a test, run again, document three functions) on `openai-codex/gpt-6-luna` at low effort, through the print mode of the same code with and without `task_progress`:

| Per six runs | Task calls only | With `task_progress` |
| --- | --- | --- |
| Model responses | 99 (14 to 20 a run) | 79 (11 to 15 a run) |
| Responses holding only task calls | 31: every task call went alone | 7: the `task_start` that opened each task, and one sent twice |
| Real calls carrying the argument | None | 73 of 73 |
| Step changes made by it | None: 25 `task_step` calls | 19 of 19 |
| Blocks whose steps match the work | 6 of 6 | 6 of 6 |

## Limits

| Limit | Effect |
| --- | --- |
| Ownership follows the model's step numbers | A model that never changes `step` gets a flat block: the outline and, under it, all the work. A step it skips stays waiting, so the task stays open after the reply. A `task_step` call placed after the real call of its response leaves that call on the previous step. |
| Opening a task still costs a response | The model opens each task with a `task_start` call of its own before the first real call. Loaded on demand instead, it was searched for and then called alone, two responses instead of one, so it stays resident. |
| Text stamps are fixed while streaming | A text block made before a task call returned keeps its first owner until the reply settles; tool blocks are corrected at once |
| 500 segments per branch | Past that the oldest replies draw their work flat again; nothing is lost |
| A Goal started on todo lists | Its unfinished todos are in no task and no tool ticks them; editing the Goal starts a revision without them |
| Text inside a block folds with it | Only text outside blocks and the final answer are always visible |

## Implementation status

Implemented: the tools, the stamps, the segments, the block in the reply, the Goal chip, the message rail, the terminal's list and what is given back after compaction. How the store keeps it is in [Task store](https://fzkuji.github.io/OpenProgram/docs/reference/design/ui/chat/todo-list.html).

| Open | State |
| --- | --- |
| Other model lines | Measured on `openai-codex/gpt-6-luna` only; models that already batch a task call with a real one gain less |
| Terminal | Its list is drawn from task tool calls, so a task opened or moved by `task_progress` does not show there |
| Measured after release | The share of replies that start a task, calls per task, and the share of tasks that never advance, per model line |
| Sub-agent ticking its parent's step | Covered by unit tests; not yet run with a real sub-agent |
| A reply with no stream events | Its blocks are not stamped; it draws as a reply without a task |

**Code**

- `openprogram/programs/tools/planning/todo/` (`task_start`, `task_step`, `task_list`, `shared.py`, `progress.py`)
- `openprogram/runtime/agent/loop/streaming.py`, `tool_dispatch.py`
- `openprogram/state/task_blocks.py`
- `openprogram/runtime/conversation/turn_runtime/stream_tap.py`
- `apps/web/lib/chat/transcript/task-blocks.ts`
- `apps/web/components/chat/messages/execution/task-block.tsx`
- `apps/web/lib/prefs/task-block-open.ts`
- `apps/web/components/chat/badges/goal-chip.tsx`
- `apps/cli/src/components/tools/toolView.ts`

[Task store](https://fzkuji.github.io/OpenProgram/docs/reference/design/ui/chat/todo-list.html)
