suiss/ui · AI
Task
A piece of work the agent is doing, with each search, read or edit listed under it as it happens.
Task is a piece of work the agent is doing, such as finding the project files or updating a page. Each step, like a search, a read or an edit, appears under the task when the agent takes it.
It is built with Trace: a TraceCollapsible for each task and a nested Trace for its steps.
Use Plan when the agent decides the steps before it starts. Use Task when the steps come from the work itself, and the agent only knows the next one once it has taken the last.
| Plan | Task | |
|---|---|---|
| Steps | Every step, from the start | Each step, once the agent takes it |
| Pending steps | Yes, waiting their turn | None |
| Title | The goal, with progress: "2 of 4 done" | What the agent is doing, then what it did |
| Per reply | One plan | One or more tasks, each closing when it is done |
Installation
Task is built with Trace.
Or use the suiss/ui CLI:
Usage
Use defaultExpanded instead of defaultOpen on TraceCollapsible.
Status
Set the task's status from its steps. Write the title in the present tense while the task runs, and in the past tense once it is done.
| Steps | status | Title |
|---|---|---|
| A step is still running | "running" | Updating the page metadata |
| A step failed | "error" | Failed to update the page metadata |
| Every step is done | none | Updated the page metadata |
Put several tasks in one Trace. Keep the running task open, and close each task once it is done.
AI SDK
Stream each task as a data part with its own id. The AI SDK replaces a data part with the same id, so writing a task again with a new step updates it in place.
API Reference
See Trace.