@@ -204,31 +204,27 @@ function agentPrompts(items: ConversationItem[]): ThreadAgentMessage[] {
204204 return prompts ;
205205}
206206
207- function AgentStatusChip ( { status } : { status : ThreadAgentStatus } ) {
208- switch ( status . phase ) {
209- case "active" :
210- return (
211- < Badge variant = "info" >
212- < Spinner className = "size-3" />
213- { status . label }
214- </ Badge >
215- ) ;
216- case "needs_input" :
217- return < Badge variant = "warning" > { status . label } </ Badge > ;
218- case "error" :
219- return < Badge variant = "destructive" > { status . label } </ Badge > ;
220- default :
221- return < Badge variant = "success" > { status . label } </ Badge > ;
222- }
207+ export function AgentStatusLine ( { status } : { status : ThreadAgentStatus } ) {
208+ return (
209+ < output
210+ aria-live = "polite"
211+ className = "flex items-center gap-1.5 px-3 py-1.5 text-muted-foreground text-xs"
212+ >
213+ { status . phase === "active" ? (
214+ < Spinner className = "size-3" />
215+ ) : (
216+ < RobotIcon size = { 12 } />
217+ ) }
218+ < span > { status . label } </ span >
219+ </ output >
220+ ) ;
223221}
224222
225223export function AgentTurnRow ( {
226224 message,
227- status,
228225 streaming,
229226} : {
230- message ?: ThreadAgentMessage ;
231- status ?: ThreadAgentStatus ;
227+ message : ThreadAgentMessage ;
232228 streaming : boolean ;
233229} ) {
234230 return (
@@ -243,25 +239,19 @@ export function AgentTurnRow({
243239 < ThreadItemContent >
244240 < ThreadItemHeader >
245241 < ThreadItemAuthor > Agent</ ThreadItemAuthor >
246- { message ? .timestamp !== undefined && (
242+ { message . timestamp !== undefined && (
247243 < ThreadTimestamp
248244 dateTime = { new Date ( message . timestamp ) . toISOString ( ) }
249245 />
250246 ) }
251247 </ ThreadItemHeader >
252- { ( message ? .text || status ) && (
248+ { message . text && (
253249 < ThreadItemBody >
254250 < div className = "rounded-md border border-border bg-muted px-2 py-1.5" >
255- { message ?. text &&
256- ( streaming ? (
257- < ChatStreamingMarkdown content = { message . text } />
258- ) : (
259- < ChatMarkdown content = { message . text } />
260- ) ) }
261- { status && (
262- < div className = { message ?. text ? "mt-2" : undefined } >
263- < AgentStatusChip status = { status } />
264- </ div >
251+ { streaming ? (
252+ < ChatStreamingMarkdown content = { message . text } />
253+ ) : (
254+ < ChatMarkdown content = { message . text } />
265255 ) }
266256 </ div >
267257 </ ThreadItemBody >
@@ -370,11 +360,6 @@ function ThreadConversation({
370360 } ) ;
371361 const { items } = useConversationItems ( events , isPromptPending ) ;
372362 const pendingPermissions = usePendingPermissionsForTask ( taskId ) ;
373- const prUrl =
374- typeof task . latest_run ?. output ?. pr_url === "string"
375- ? task . latest_run . output . pr_url
376- : undefined ;
377-
378363 const agentMsgs = useMemo ( ( ) => agentTurns ( items ) , [ items ] ) ;
379364 const promptMsgs = useMemo ( ( ) => agentPrompts ( items ) , [ items ] ) ;
380365
@@ -388,7 +373,6 @@ function ThreadConversation({
388373 pendingPermissionCount : pendingPermissions . size ,
389374 isPromptPending,
390375 isInitializing,
391- hasPullRequest : ! ! prUrl ,
392376 } ) ,
393377 [
394378 events . length ,
@@ -399,7 +383,6 @@ function ThreadConversation({
399383 pendingPermissions . size ,
400384 isPromptPending ,
401385 isInitializing ,
402- prUrl ,
403386 ] ,
404387 ) ;
405388
@@ -498,7 +481,7 @@ function ThreadConversation({
498481 } ) ;
499482 } ;
500483
501- const isEmpty = timeline . length === 0 && ! agentStatus ;
484+ const isEmpty = timeline . length === 0 ;
502485 const isReady = ! isInitializing && ! isLoading ;
503486
504487 return (
@@ -595,13 +578,12 @@ function ThreadConversation({
595578 />
596579 ) ,
597580 ) }
598- { agentStatus && ! ( agentStatus . phase === "complete" && ! ! prUrl ) && (
599- < AgentTurnRow status = { agentStatus } streaming = { false } />
600- ) }
601581 </ ThreadItemGroup >
602582 ) }
603583 </ div >
604584
585+ { agentStatus && < AgentStatusLine status = { agentStatus } /> }
586+
605587 < div className = "border-border border-t p-2" >
606588 < MentionComposer
607589 value = { draft }
0 commit comments