The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
fix(desktop): the onboarding tour no longer leaves a preview row for the app's own page (#128211)
Siddharth Balyanbddd22be7c2e
diff --git a/apps/desktop/src/components/assistant-ui/connector-tool.tsx b/apps/desktop/src/components/assistant-ui/connector-tool.tsxindex 31ed231ae1c..68b3dda179c 100644--- a/apps/desktop/src/components/assistant-ui/connector-tool.tsx+++ b/apps/desktop/src/components/assistant-ui/connector-tool.tsx@@ -408,6 +408,7 @@ export function ConnectorExecution(props: ToolCallMessagePartProps) {<ToolFallback{...props}args={recordOf(recordOf(batch[index]).arguments ?? props.args)}+ innerToolName={props.toolName === 'tool_call' ? label.name : props.toolName}isError={Boolean(result.error) || props.isError === true}key={`${props.toolCallId}:${index}`}result={item}diff --git a/apps/desktop/src/components/assistant-ui/tool/fallback-model/index.ts b/apps/desktop/src/components/assistant-ui/tool/fallback-model/index.tsindex b00f3c68840..91f86eefb7b 100644--- a/apps/desktop/src/components/assistant-ui/tool/fallback-model/index.ts+++ b/apps/desktop/src/components/assistant-ui/tool/fallback-model/index.ts@@ -751,9 +751,27 @@ function durationLabel(resultRecord: Record<string, unknown>): string | undefinereturn formatDurationSeconds(seconds)}+const NON_DELIVERABLE_TOOLS = new Set([+ 'annotate_preview',+ 'drive_preview',+ 'gui_tour',+ 'list_files',+ 'read_file',+ 'search_files'+])+function toolPreviewTarget(toolName: string, args: Record<string, unknown>, result: Record<string, unknown>): string {+ if (toolName === 'tool_call') {+ const calls = Array.isArray(args.calls) ? args.calls : [args]+ const call = parseMaybeObject(calls[0])++ if (calls.length === 1 && typeof call.name === 'string') {+ return toolPreviewTarget(call.name, parseMaybeObject(call.arguments), result)+ }+ }+// Reading an existing file is not producing a deliverable.- if (toolName === 'read_file' || toolName === 'search_files' || toolName === 'list_files') {+ if (NON_DELIVERABLE_TOOLS.has(toolName) || (toolName === 'desktop_preview' && args.action !== 'open')) {return ''}@@ -1549,7 +1567,7 @@ export function buildToolView(part: ToolPart, inlineDiff: string): ToolView {icon: meta.icon,imageUrl: toolImageUrl(argsRecord, resultRecord),inlineDiff,- previewTarget: toolPreviewTarget(part.toolName, argsRecord, resultRecord),+ previewTarget: toolPreviewTarget(part.innerToolName || part.toolName, argsRecord, resultRecord),rendersAnsi: rendersAnsi || undefined,searchQuery: searchQuery || undefined,searchHits: searchHits?.length ? searchHits : undefined,diff --git a/apps/desktop/src/components/assistant-ui/tool/fallback-model/types.ts b/apps/desktop/src/components/assistant-ui/tool/fallback-model/types.tsindex 856dfa5fb68..7ea6d09cc0b 100644--- a/apps/desktop/src/components/assistant-ui/tool/fallback-model/types.ts+++ b/apps/desktop/src/components/assistant-ui/tool/fallback-model/types.ts@@ -7,6 +7,7 @@ export interface ToolPart {toolResultMetadata?: ToolResultMetadataargs?: unknowncompletedAt?: number+ innerToolName?: stringinterrupted?: booleanisError?: booleanresult?: unknowndiff --git a/apps/desktop/src/components/assistant-ui/tool/fallback.tsx b/apps/desktop/src/components/assistant-ui/tool/fallback.tsxindex e097dbf18ce..d10ddb20a6b 100644--- a/apps/desktop/src/components/assistant-ui/tool/fallback.tsx+++ b/apps/desktop/src/components/assistant-ui/tool/fallback.tsx@@ -358,12 +358,24 @@ function ToolEntry({ part }: ToolEntryProps) {// below and re-running buildToolView (full JSON.stringify of result) on every// stream delta — the freeze on big `/learn` runs. Re-derive a stable part from// the referentially-stable args/result so the memos hold across deltas.- const { args, completedAt, interrupted, isError, result, toolResultMetadata, timestamp, toolCallId, toolName } = part+ const {+ args,+ completedAt,+ innerToolName,+ interrupted,+ isError,+ result,+ toolResultMetadata,+ timestamp,+ toolCallId,+ toolName+ } = partconst stablePart = useMemo<ToolPart>(() => ({args,completedAt,+ innerToolName,interrupted,isError,result,@@ -373,7 +385,18 @@ function ToolEntry({ part }: ToolEntryProps) {toolName,type: 'tool-call'}),- [args, completedAt, interrupted, isError, result, toolResultMetadata, timestamp, toolCallId, toolName]+ [+ args,+ completedAt,+ innerToolName,+ interrupted,+ isError,+ result,+ toolResultMetadata,+ timestamp,+ toolCallId,+ toolName+ ])const disclosureId = toolEntryDisclosureId(messageId, stablePart)@@ -1089,13 +1112,14 @@ export const ToolGroupSlot: FC<PropsWithChildren<{ endIndex: number; startIndex:* group-shape changes.*/type TimelineToolCallProps = ToolCallMessagePartProps &- Pick<ToolPart, 'completedAt' | 'interrupted' | 'timestamp' | 'toolResultMetadata'>+ Pick<ToolPart, 'completedAt' | 'innerToolName' | 'interrupted' | 'timestamp' | 'toolResultMetadata'>export const ToolFallback = ({toolCallId,toolName,args,completedAt,+ innerToolName,interrupted,isError,result,@@ -1105,6 +1129,7 @@ export const ToolFallback = ({const part: ToolPart = {args,completedAt,+ innerToolName,interrupted,isError,result,