@@ -411,6 +411,15 @@ function resolveCommandProgressCorrelationKey(input: { toolCallId?: string }): s
411411 return toolCallId ? `command:${ toolCallId } ` : undefined ;
412412}
413413
414+ function isTerminalProgressStatus ( status : string | undefined ) : boolean {
415+ const normalized = normalizeOptionalLowercaseString ( status ) ;
416+ return (
417+ normalized === "completed" ||
418+ normalized === "failed" ||
419+ normalized ?. startsWith ( "exit " ) === true
420+ ) ;
421+ }
422+
414423function isEmptyReasoningProgressItem (
415424 input : Extract < ChannelProgressDraftLineInput , { event : "item" } > ,
416425 meta : string | undefined ,
@@ -444,15 +453,6 @@ function buildCommandOutputProgressLine(
444453 return line ;
445454 }
446455 if ( status === "completed" ) {
447- if ( ! line . detail ) {
448- const statusLine = {
449- ...line ,
450- detail : status ,
451- text : formatToolAggregate ( name , [ status ] , { markdown : options ?. markdown } ) ,
452- } ;
453- setProgressDraftLineCorrelationKey ( statusLine , correlationKey ) ;
454- return statusLine ;
455- }
456456 return line ;
457457 }
458458 if ( ! line . detail || line . detail === status ) {
@@ -1153,13 +1153,16 @@ function mergeProgressDraftLineUpdate<TLine extends string | ChannelProgressDraf
11531153 if (
11541154 line . kind !== "command-output" ||
11551155 ! line . status ||
1156- line . status === "completed" ||
11571156 ( line . detail && line . detail !== line . status )
11581157 ) {
11591158 return line ;
11601159 }
11611160 const previousDetail = previous . detail ?. trim ( ) ;
1162- if ( ! previousDetail || previousDetail === previous . status ) {
1161+ if (
1162+ ! previousDetail ||
1163+ previousDetail === previous . status ||
1164+ isTerminalProgressStatus ( previous . status )
1165+ ) {
11631166 return line ;
11641167 }
11651168 const replacement = {
0 commit comments