suiss/ui · AI
Stack Trace
A failed tool call with its stack frames, linking your own frames and folding the framework ones.
Stack Trace is a row for a tool call that failed. The error is the title, such as "Failed: TypeError". Open it for the stack frames, which can link to the file and line.
The frames are a TraceCollapsible with a nested Trace. For a failure inside a test run, use Test Results.
Installation
Stack Trace is built with the Trace and Code Block components.
Works in any project with a components.json. See Installation for the one-line registry setup. Or use the suiss/ui CLI:
Usage
The title truncates, so repeat the full error at the top of the content. Frames from node_modules stay muted, so your own frames stand out.
Examples
Frame links
Turns your own frames into links that open the file at the line, and folds the framework frames into a collapsible row of their own, so the frames you can fix come first.
AI SDK
When a tool throws, its part is output-error. By default errorText is only the error message, with no frames. Return error.stack from onError in toUIMessageStreamResponse to send them.
A stack shows file paths from your server, so only send it in development.
Map the other tool states as in Tool.
API Reference
See Trace and Code Block.
Stack Trace on mobile is built from the same parts as on the web: Trace, Code Block, Message, Bubble. The example above is a static demo; connect it to your agent by rendering the same parts from your messages.
Installation
API Reference
See Trace, Code Block, Message, Bubble.