Skip to content

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

fix(ui): tab close stopPropagation + settled-message requestId path for inline cards

Sanilc90608748633
diff --git a/app/src/features/conversations/aui/ArtifactPreviewPanel.tsx b/app/src/features/conversations/aui/ArtifactPreviewPanel.tsx
index 48f13ca0ab..af494e3f41 100644
--- a/app/src/features/conversations/aui/ArtifactPreviewPanel.tsx
+++ b/app/src/features/conversations/aui/ArtifactPreviewPanel.tsx
@@ -166,7 +166,7 @@ export function ArtifactPreviewPanel({ artifactId, onClose }: ArtifactPreviewPan
<span className="truncate max-w-[110px]">{a.title}</span>
</button>
<button
- onClick={() => handleCloseTab(a.artifactId)}
+ onClick={(e) => { e.stopPropagation(); handleCloseTab(a.artifactId); }}
className="ml-0.5 rounded p-0.5 text-muted-foreground/50 hover:bg-accent hover:text-foreground shrink-0"
title="Close artifact"
>
diff --git a/app/src/features/conversations/aui/MessageArtifactCards.tsx b/app/src/features/conversations/aui/MessageArtifactCards.tsx
index 1f440fa263..c7899d406e 100644
--- a/app/src/features/conversations/aui/MessageArtifactCards.tsx
+++ b/app/src/features/conversations/aui/MessageArtifactCards.tsx
@@ -18,7 +18,14 @@ import { ArtifactCardAdapter } from './ArtifactCardAdapter';
* tool call via `MediaAndDocumentCalls`.
*/
export function MessageArtifactCards() {
- const requestId = useAuiState(s => s.message.metadata?.custom?.requestId as string | undefined);
+ // requestId lives at different paths for live vs settled messages:
+ // - live streaming message: metadata.custom.requestId
+ // - settled message: metadata.custom.extraMetadata.requestId
+ const meta = useAuiState(s => s.message.metadata?.custom as Record<string, unknown> | undefined);
+ const requestId = typeof meta?.requestId === 'string' ? meta.requestId
+ : typeof (meta?.extraMetadata as Record<string, unknown> | undefined)?.requestId === 'string'
+ ? (meta?.extraMetadata as Record<string, unknown> | undefined)?.requestId as string
+ : undefined;
const threadId = useAppSelector(s => s.thread.selectedThreadId as string | undefined);
const dispatch = useAppDispatch();