File tree Expand file tree Collapse file tree
apps/sim/lib/logs/execution/trace-spans Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -14,8 +14,6 @@ import type {
1414
1515const logger = createLogger ( 'SpanFactory' )
1616
17- const STREAMING_SEGMENT_NAME = 'Streaming response'
18-
1917/** A BlockLog that has already passed the id/type validity check. */
2018type ValidBlockLog = BlockLog & { blockType : string }
2119
@@ -168,9 +166,10 @@ function buildChildrenFromTimeSegments(
168166 let segmentEndTime = new Date ( segment . endTime ) . toISOString ( )
169167 let segmentDuration = segment . duration
170168
171- // Streaming segments sometimes close before the block ends; extend the
172- // trailing streaming segment to the block endTime so the bar fills.
173- if ( segment . name === STREAMING_SEGMENT_NAME && log . endedAt ) {
169+ // The final model segment sometimes closes before the block ends (e.g. when
170+ // post-processing runs after the stream). Extend it to the block endTime so
171+ // the Gantt bar fills to the edge rather than leaving a trailing gap.
172+ if ( index === segments . length - 1 && segment . type === 'model' && log . endedAt ) {
174173 const blockEndMs = new Date ( log . endedAt ) . getTime ( )
175174 const segmentEndMs = new Date ( segment . endTime ) . getTime ( )
176175 if ( blockEndMs > segmentEndMs ) {
You can’t perform that action at this time.
0 commit comments