Skip to main content

Chat

SubagentThread

A piece of work your agent handed to a helper agent, as a row in the conversation: who, what for, and where it stands, with what they are doing now while they run and what came of it once they finish, how many steps they took and for how long. Open thread opens everything they did in your ThreadRail, inside ThreadLayout, which gives focus back to the button when the thread closes. A helper waiting for the person says "Waiting for you"; put the PermissionPrompt or PlanApproval they wait on in their thread. Status is said in words, not only by colour, and a screen reader hears it with the row's name.

Research helper Find three weeknight dinners, running

Reading recipes/roast.md

4 steps · 38s

Shopping helper Build the grocery list, waiting for you

Waiting for you: Asking to add a package

2 steps · 12s

Research helper Check the oven temperatures, done

All three bake at 200°C.

12 steps · 1m 4s

Install

Hand it to your agent
Add SubagentThread from Ouro UI to this app. Read https://ui.ouroboros.bot/docs/subagent-thread.md first and follow it.

Or by hand. Once per app, with Tailwind CSS v4 and an @/* path alias (Ouro HX is built on Base UI, so --base base; skip -t in an existing app):

npx shadcn@latest init --base base --preset nova --yes --no-monorepo
npx shadcn@latest add ourostack/ouro-ui/ouro-base#v1.3.823

Then the component (Installing):

npx shadcn@latest add ourostack/ouro-ui/subagent-thread#v1.3.823
import { SubagentThread } from "@/components/ouro/subagent-thread/subagent-thread";

Paths use shadcn's default @/ alias; the CLI rewrites them to yours.

Example

<ThreadLayout
  conversation={<SubagentThread name="Research helper" task="Find three weeknight dinners" status="running" latest="Reading recipes/roast.md" steps={4} duration={38} onOpen={() => setOpen(true)} open={open} />}
  thread={open ? <ThreadRail label="Research helper's thread" title="Research helper" onClose={() => setOpen(false)}>{calls}</ThreadRail> : null}
/>

Use instead when

  • Use ToolCall instead for one call to a tool, and ToolCallGroup for several in a row.
  • Use AgentPresence instead for agents listening on the person's behalf outside a conversation.

Props

Type: SubagentThreadProps.

className
Type: string
Layout only: margins, width (mt-1). Appearance classes warn in development.
duration
Type: number
How long they have worked, in seconds, shown short: "1m 4s".
latest
Type: ReactNode
What they are doing right now, shown while they run or wait: "Reading recipes/roast.md".
name (required)
Type: ReactNode
Who the agent handed the work to, as the person knows them: "Research helper".
onOpen
Type: (() => void)
Called when the person presses Open thread: open the helper's thread in your ThreadRail beside the conversation. The button shows only when you pass it.
open
Type: boolean
Whether their thread is open now: the button is filled, and says so to a screen reader (aria-expanded).
openLabel
Type: string
Default: "Open thread"
The button's label. A screen reader hears it with the helper's name: "Open thread for Research helper".
ref
Type: Ref<HTMLElement>
Reaches the rendered element.
status (required)
Type: "failed" | "running" | "done" | "waiting"
Where their work stands, as a ToolCall's does. running shows a spinner; done a tick; failed a cross and "Failed"; waiting (for the person, such as for their permission) a clock and "Waiting for you".
steps
Type: number
How many steps they have taken so far, such as tool calls: "12 steps".
summary
Type: ReactNode
What came of it, shown once they are done or have failed: "Found three weeknight dinners."
task (required)
Type: ReactNode
What they were asked to do, in a few words: "Find three weeknight dinners".

Don't use

These are not props. Passing one fails the type check with the fix in the error, and in development a console message names the fix.

  • agent: Not a prop. Who did the work is name: <SubagentThread name="Research helper">.
  • description: Not a prop. What they were asked is task: <SubagentThread task="Find three dinners">.
  • onClick: Not a prop. The button calls onOpen: <SubagentThread onOpen={openThread}>.
  • result: Not a prop. What came of it is summary: <SubagentThread summary="Found three">.
  • state: Not a prop. Where the work stands is status: <SubagentThread status="running">.
  • title: Not a prop. What they were asked is task: <SubagentThread task="Find three dinners">.

className is for layout only

Pass margins, width and grid placement (mt-4, w-full, col-span-2).

Appearance comes from props, not classes. In development, a class that sets appearance logs one warning per component instance, naming the prop to use instead. A class sets appearance when, after its variants (hover:, sm:) and any ! are removed, it starts with bg-, text-, border-, rounded-, shadow-, font-, ring-, from-, via-, to-, fill- or stroke-, or is border, rounded, shadow or ring, or has a dark: variant. Text wrapping, overflow and table layout classes (text-wrap, text-ellipsis, border-collapse) are layout and do not warn.

Alignment classes (text-center) warn too: set alignment on a parent element.