@@ -2,6 +2,7 @@ import { TextAttributes } from '@opentui/core'
22import { pluralize } from '@codebuff/common/util/string'
33import React , { memo , useCallback , useMemo , type ReactNode } from 'react'
44
5+ import { shouldRenderAsSimpleText } from '../utils/constants'
56import { AgentBranchItem } from './agent-branch-item'
67import { ElapsedTimer } from './elapsed-timer'
78import { FeedbackIconButton } from './feedback-icon-button'
@@ -28,6 +29,7 @@ import { ContentWithMarkdown } from './blocks/content-with-markdown'
2829import { ToolBranch } from './blocks/tool-branch'
2930import { PlanBox } from './renderers/plan-box'
3031import { AgentListBranch } from './blocks/agent-list-branch'
32+ import { BULLET_CHAR } from '../utils/strings'
3133
3234interface MessageBlockProps {
3335 messageId : string
@@ -85,7 +87,7 @@ export const MessageBlock = memo((props: MessageBlockProps): ReactNode => {
8587 } )
8688
8789 const theme = useTheme ( )
88-
90+
8991 // Memoize selectors to prevent new function references on every render
9092 const selectIsFeedbackOpenMemo = useMemo (
9193 ( ) => selectIsFeedbackOpenForMessage ( messageId ) ,
@@ -99,10 +101,12 @@ export const MessageBlock = memo((props: MessageBlockProps): ReactNode => {
99101 ( ) => selectMessageFeedbackCategory ( messageId ) ,
100102 [ messageId ] ,
101103 )
102-
104+
103105 const isFeedbackOpen = useFeedbackStore ( selectIsFeedbackOpenMemo )
104106 const hasSubmittedFeedback = useFeedbackStore ( selectHasSubmittedFeedbackMemo )
105- const selectedFeedbackCategory = useFeedbackStore ( selectMessageFeedbackCategoryMemo )
107+ const selectedFeedbackCategory = useFeedbackStore (
108+ selectMessageFeedbackCategoryMemo ,
109+ )
106110
107111 const resolvedTextColor = textColor ?? theme . foreground
108112 const shouldShowLoadingTimer = isAi && isLoading && ! isComplete
@@ -578,6 +582,28 @@ const AgentBranchWrapper = memo(
578582 onBuildMax,
579583 } : AgentBranchWrapperProps ) => {
580584 const theme = useTheme ( )
585+
586+ if ( shouldRenderAsSimpleText ( agentBlock . agentType ) ) {
587+ return (
588+ < box
589+ key = { keyPrefix }
590+ style = { {
591+ flexDirection : 'column' ,
592+ } }
593+ >
594+ < text
595+ style = { {
596+ wrapMode : 'word' ,
597+ fg : theme . muted ,
598+ } }
599+ attributes = { TextAttributes . ITALIC }
600+ >
601+ { BULLET_CHAR } Selecting the best implementation...
602+ </ text >
603+ </ box >
604+ )
605+ }
606+
581607 const isCollapsed = agentBlock . isCollapsed ?? false
582608 const isStreaming =
583609 agentBlock . status === 'running' || streamingAgents . has ( agentBlock . agentId )
@@ -626,11 +652,11 @@ const AgentBranchWrapper = memo(
626652 const nParameterMessage =
627653 agentBlock . params ?. n !== undefined &&
628654 ( agentBlock . agentType . includes ( 'editor-best-of-n' )
629- ? `Generating ${ agentBlock . params . n } implementations...`
655+ ? `${ BULLET_CHAR } Generating ${ agentBlock . params . n } implementations...`
630656 : agentBlock . agentType . includes ( 'thinker-best-of-n' )
631- ? `Generating ${ agentBlock . params . n } deep thoughts...`
657+ ? `${ BULLET_CHAR } Generating ${ agentBlock . params . n } deep thoughts...`
632658 : agentBlock . agentType . includes ( 'code-reviewer-best-of-n' )
633- ? `Generating ${ agentBlock . params . n } code reviews...`
659+ ? `${ BULLET_CHAR } Generating ${ agentBlock . params . n } code reviews...`
634660 : undefined )
635661
636662 return (
0 commit comments