Improve Web App UI for get-task-status function call
When an agent makes a function call to view the task status of a child session, depending on the arguments, it can return the complete response.
It would be nice to have this better formatted and a more rich first-party presentation of this tool call within the UI
current
Hi! I'd like to work on this issue.
thanks @heat0206!
I'm happy to extend this further with a richer custom UI component if maintainers would prefer a more structured presentation of task metadata and final responses.
this was something I had more in mind, basically some kind of rich formatted UI that would better show the output
@open-inspect[bot] the code currently doesn't look setup to render custom component UIs for tools. Review through the surrounding code and provide a high level overview of what would be required to do this?
I reviewed the current event/rendering path. High-level: the web app can support this, but today it is only set up for generic tool rendering plus a one-off slack-notify special case, not a reusable custom component system.
Relevant current flow:
SandboxEventdefinestool_callas{ tool, args, callId, status?, output?, ... }inpackages/shared/src/types/index.ts. Theoutputis just a string.- The control plane persists/broadcasts
tool_callevents opaquely inpackages/control-plane/src/session/sandbox-events.ts; it does not interpret tool-specific payloads. - The session page groups consecutive
tool_callevents inpackages/web/src/app/(app)/session/[id]/page.tsxand renders them throughToolCallGroup/ToolCallItem. ToolCallItemcurrently renders generic JSON args + preformatted output. The only custom UI path is a directif (event.tool === "slack-notify") return <SlackNotifyEvent ... />branch inpackages/web/src/components/tool-call-item.tsx.get-task-statuscurrently returns formatted plain text frompackages/sandbox-runtime/src/sandbox_runtime/tools/get-task-status-format.js, even though the underlying control-plane child summary endpoint already returns structured JSON (ChildSessionDetail) with session metadata, artifacts, recent events, optional final response, and optional trajectory.
What I think would be required:
-
Introduce a first-class custom tool renderer layer in the web app instead of adding more
if (tool === ...)branches. For example, a registry keyed by normalized tool name that can provide collapsed summary metadata and an expanded React component, with a generic fallback using the currentformatToolCallbehavior. -
Decide on the data contract for rich tool output. There are two viable approaches:
- Minimal/fast path: keep the existing tool output as text and have a
get-task-statusrenderer parse the known formatted output. This is brittle and probably not worth building around. - Better path: have tools that need rich rendering emit a structured JSON envelope in
tool_call.output, e.g.{ ok: true, renderer: "get-task-status", version: 1, data: <ChildSessionDetail or list payload> }, while preserving readable fallback text if needed. This mirrors theslack-notifydirection, but should be formalized rather than tool-specific.
- Minimal/fast path: keep the existing tool output as text and have a
-
Extend shared types to document the optional structured output/envelope shape. The existing
SandboxEvent.tool_call.outputcan remain a string for compatibility, but the renderer should parse JSON defensively and fall back to generic output on malformed/unknown versions. If we want stronger typing across packages, add shared types forget-task-statusUI payloads rather than duplicating shape in web. -
Update
get-task-statusinpackages/sandbox-runtimeto return the structured payload for both modes:- list mode: child task count summary + child rows with id/title/status/createdAt
- detail mode: the existing
ChildSessionDetailJSON from the control-plane endpoint, including final response and trajectory when requested The current text formatter can still be used as a fallback field or by clients that do not render the envelope.
-
Build a
GetTaskStatusEventcomponent inpackages/weband register it. The useful UI would likely include status badge, title/task id, repo/branch/model, created/updated timestamps, artifact links, final response rendered with existing markdown/safe text handling, tool summary, recent events, and a paginated trajectory hint whencursoris present. -
Keep grouping behavior in mind.
ToolCallGroupgroups consecutive calls byevent.tool, so a custom renderer must work both as a single expanded item and inside a grouped list. The registry should be used byToolCallItem, and optionally byformatToolGroupif grouped summaries should become richer. -
Add tests at the renderer and formatter boundaries:
- registry falls back for unknown tools / invalid envelopes
get-task-statuslist and detail payloads render correctly- long final responses and trajectory/event data are bounded and safe to display
- existing generic rendering and
slack-notifybehavior are unchanged
So the main implementation is not in the control-plane event pipeline; that path is already generic enough. The work is mostly: formalize a structured tool-output envelope, emit it from get-task-status, replace the one-off custom renderer branch with a small registry, and add the first get-task-status rich component on top of that.
Thanks, this makes sense.
For the renderer registry approach, would you prefer introducing the registry first and migrating the existing slack-notify special case to it, then adding get-task-status on top? Or would you prefer keeping the existing slack-notify implementation as-is and only using the registry for new tool renderers?
introducing the registry first and migrating the existing slack-notify special case to it
this makes sense to me. let's introduce the registry with slack-notify as the first use-case, and then can create a follow-up change with the get-task-status specific one
Sounds good, that approach makes sense to me.
I'll take a look at introducing the renderer registry first and moving the existing slack-notify implementation over to it. Once that's in place, we can build the get-task-status renderer on top of the new structure.
Resolved by #2424 (merged 2026-10-15), following the plan agreed above. Verified on current main.
- Renderer registry:
packages/web/src/components/tool-call-renderers.tsxreplaces the one-offslack-notifybranch, andToolCallItemdispatches throughgetToolRenderer().slack-notifywas migrated to the registry first. - Rich child-status presentation:
get-child-status, and the legacyget-task-statusname, render throughchild-status-details.tsx. It shows child session metadata and links, status, and the final response as sanitized Markdown. Legacy plain-text output falls back to the generic view. - Structured payload: a versioned format (
packages/shared/src/child-status-tool.ts) is produced by the sandbox-runtime tool, with tests on both sides.
Closing.