Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

feat(aui): show failed artifact snapshot in document call component

Steven Enamakel34758ca2f0b9
diff --git a/app/src/features/conversations/aui/MediaAndDocumentCalls.tsx b/app/src/features/conversations/aui/MediaAndDocumentCalls.tsx
index c72e9dea89..f75828bc41 100644
--- a/app/src/features/conversations/aui/MediaAndDocumentCalls.tsx
+++ b/app/src/features/conversations/aui/MediaAndDocumentCalls.tsx
@@ -91,12 +91,22 @@ const DOCUMENT_TOOL_ICONS: Record<string, typeof FileTextIcon> = {
* artifact's title once it returns.
*/
export const DocumentArtifactCall: ToolCallMessagePartComponent = ({
+ toolCallId,
toolName,
args,
result,
status,
}) => {
const { t } = useT();
+ const threadId = useAuiThreadId();
+ // A failed `artifact_failed` snapshot for THIS call, when the producing
+ // tool reported one and the core sent `tool_call_id` on the event —
+ // `Conversations.tsx` filters an artifact carrying `toolCallId` OUT of the
+ // header's live-artifact deck precisely so it renders here instead.
+ const failedArtifact = useAppSelector(state => {
+ const list = threadId ? state.chatRuntime.artifactsByThread[threadId] : undefined;
+ return list?.find(a => a.toolCallId === toolCallId && a.status === 'failed');
+ });
const running = status?.type === 'running';
const Icon = DOCUMENT_TOOL_ICONS[toolName] ?? FileTextIcon;
const kindTitle =