@@ -10,10 +10,10 @@ import { getRegisteredTools } from '@/lib/copilot/tools/client/registry'
1010// Initialize all tool UI configs
1111import '@/lib/copilot/tools/client/init-tool-configs'
1212import {
13- getToolUIConfig ,
14- isSpecialTool as isSpecialToolFromConfig ,
1513 getSubagentLabels as getSubagentLabelsFromConfig ,
14+ getToolUIConfig ,
1615 hasInterrupt as hasInterruptFromConfig ,
16+ isSpecialTool as isSpecialToolFromConfig ,
1717} from '@/lib/copilot/tools/client/ui-config'
1818import CopilotMarkdownRenderer from '@/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/copilot/components/copilot-message/components/markdown-renderer'
1919import { SmoothStreamingText } from '@/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/copilot/components/copilot-message/components/smooth-streaming'
@@ -357,19 +357,21 @@ export function OptionsSelector({
357357 disabled && 'cursor-not-allowed opacity-50' ,
358358 streaming && 'pointer-events-none' ,
359359 isLocked && 'cursor-default' ,
360- isHovered && ! streaming && 'is-hovered bg-[var(--surface-6)] dark:bg-[var(--surface-5)]'
360+ isHovered &&
361+ ! streaming &&
362+ 'is-hovered bg-[var(--surface-6)] dark:bg-[var(--surface-5)]'
361363 ) }
362364 >
363365 < Button
364366 variant = '3d'
365- className = 'group-hover:-translate-y-0.5 group-[.is-hovered]:-translate-y-0.5 w-[22px] py-[2px] text-[11px] group-hover:text-[var(--text-primary)] group-[ .is-hovered]:text-[var(--text-primary)] group-hover:shadow-[0_4px_0_0_rgba(48,48,48,1 )] group-[.is-hovered]:shadow-[0_4px_0_0_rgba(48,48,48,1)]'
367+ className = 'group-hover:-translate-y-0.5 group-[.is-hovered]:-translate-y-0.5 w-[22px] py-[2px] text-[11px] group-hover:text-[var(--text-primary)] group-hover:shadow-[0_4px_0_0_rgba(48,48,48,1)] group-[ .is-hovered]:text-[var(--text-primary)] group-[.is-hovered]:shadow-[0_4px_0_0_rgba(48,48,48,1)]'
366368 >
367369 { option . key }
368370 </ Button >
369371
370372 < span
371373 className = { clsx (
372- 'min-w-0 flex-1 pt-0.5 font-season text-[12px] leading-5 text-[var(--text-tertiary)] group-hover:text-[var(--text-primary)] group-[.is-hovered]:text-[var(--text-primary)] [&_code]:px-1 [&_code]:py-0.5 [&_code]:text-[11px] [&_p]:m-0 [&_p]:leading-5' ,
374+ 'min-w-0 flex-1 pt-0.5 font-season text-[12px] text-[var(--text-tertiary)] leading-5 group-hover:text-[var(--text-primary)] group-[.is-hovered]:text-[var(--text-primary)] [&_code]:px-1 [&_code]:py-0.5 [&_code]:text-[11px] [&_p]:m-0 [&_p]:leading-5' ,
373375 isRejected && 'text-[var(--text-tertiary)] line-through opacity-50'
374376 ) }
375377 >
@@ -1158,7 +1160,9 @@ function SubagentContentRenderer({
11581160 } , [ isStreaming , shouldCollapse ] )
11591161
11601162 // Build segments: each segment is either text content or a tool call
1161- const segments : Array < { type : 'text' ; content : string } | { type : 'tool' ; block : SubAgentContentBlock } > = [ ]
1163+ const segments : Array <
1164+ { type : 'text' ; content : string } | { type : 'tool' ; block : SubAgentContentBlock }
1165+ > = [ ]
11621166 let currentText = ''
11631167 let allRawText = ''
11641168
@@ -1916,20 +1920,21 @@ export function ToolCall({ toolCall: toolCallProp, toolCallId, onStateChange }:
19161920 'workflow' ,
19171921 ]
19181922 const isSubagentTool = SUBAGENT_TOOLS . includes ( toolCall . name )
1919-
1923+
19201924 // For ALL subagent tools, don't show anything until we have blocks with content
19211925 if ( isSubagentTool ) {
19221926 // Check if we have any meaningful content in blocks
1923- const hasContent = toolCall . subAgentBlocks && toolCall . subAgentBlocks . some ( block =>
1924- ( block . type === 'subagent_text' && block . content ?. trim ( ) ) ||
1925- ( block . type === 'subagent_tool_call' && block . toolCall )
1927+ const hasContent = toolCall . subAgentBlocks ?. some (
1928+ ( block ) =>
1929+ ( block . type === 'subagent_text' && block . content ?. trim ( ) ) ||
1930+ ( block . type === 'subagent_tool_call' && block . toolCall )
19261931 )
1927-
1932+
19281933 if ( ! hasContent ) {
19291934 return null
19301935 }
19311936 }
1932-
1937+
19331938 if ( isSubagentTool && toolCall . subAgentBlocks && toolCall . subAgentBlocks . length > 0 ) {
19341939 // Render subagent content using the dedicated component
19351940 return (
@@ -1975,9 +1980,9 @@ export function ToolCall({ toolCall: toolCallProp, toolCallId, onStateChange }:
19751980 // Check UI config for secondary action
19761981 const toolUIConfig = getToolUIConfig ( toolCall . name )
19771982 const secondaryAction = toolUIConfig ?. secondaryAction
1978- const showSecondaryAction =
1979- secondaryAction &&
1980- secondaryAction . showInStates . includes ( toolCall . state as ClientToolCallState )
1983+ const showSecondaryAction = secondaryAction ?. showInStates . includes (
1984+ toolCall . state as ClientToolCallState
1985+ )
19811986
19821987 // Legacy fallbacks for tools that haven't migrated to UI config
19831988 const showMoveToBackground =
@@ -2396,7 +2401,10 @@ export function ToolCall({ toolCall: toolCallProp, toolCallId, onStateChange }:
23962401 ) }
23972402 { /* Render subagent content as thinking text */ }
23982403 { toolCall . subAgentBlocks && toolCall . subAgentBlocks . length > 0 && (
2399- < SubAgentThinkingContent blocks = { toolCall . subAgentBlocks } isStreaming = { toolCall . subAgentStreaming } />
2404+ < SubAgentThinkingContent
2405+ blocks = { toolCall . subAgentBlocks }
2406+ isStreaming = { toolCall . subAgentStreaming }
2407+ />
24002408 ) }
24012409 </ div >
24022410 )
@@ -2455,7 +2463,10 @@ export function ToolCall({ toolCall: toolCallProp, toolCallId, onStateChange }:
24552463 ) }
24562464 { /* Render subagent content as thinking text */ }
24572465 { toolCall . subAgentBlocks && toolCall . subAgentBlocks . length > 0 && (
2458- < SubAgentThinkingContent blocks = { toolCall . subAgentBlocks } isStreaming = { toolCall . subAgentStreaming } />
2466+ < SubAgentThinkingContent
2467+ blocks = { toolCall . subAgentBlocks }
2468+ isStreaming = { toolCall . subAgentStreaming }
2469+ />
24592470 ) }
24602471 </ div >
24612472 )
@@ -2564,7 +2575,10 @@ export function ToolCall({ toolCall: toolCallProp, toolCallId, onStateChange }:
25642575
25652576 { /* Render subagent content as thinking text */ }
25662577 { toolCall . subAgentBlocks && toolCall . subAgentBlocks . length > 0 && (
2567- < SubAgentThinkingContent blocks = { toolCall . subAgentBlocks } isStreaming = { toolCall . subAgentStreaming } />
2578+ < SubAgentThinkingContent
2579+ blocks = { toolCall . subAgentBlocks }
2580+ isStreaming = { toolCall . subAgentStreaming }
2581+ />
25682582 ) }
25692583 </ div >
25702584 )
0 commit comments