File tree Expand file tree Collapse file tree
apps/sim/lib/copilot/request/go Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -571,14 +571,14 @@ function stampSseReadLoopSpan(
571571 const nowWall = Date . now ( )
572572 const startWall = nowWall - ( nowPerf - startPerfMs )
573573
574- const terminalEventSeen = counters . eventsByType . complete > 0
574+ const terminalEventSeen = counters . eventsByType . complete > 0 || counters . eventsByType . error > 0
575575 // `terminal_event_missing` is the single-attribute dashboard signal
576576 // for the "disappeared response" bug class: the caller considered
577577 // this leg to be the final one (`context.streamComplete === true`)
578- // but no `complete` event arrived on the wire. Tool-pause legs have
579- // expectedTerminal=false and never trip this, so dashboards can
580- // filter on `{ .copilot.sse.terminal_event_missing = true }` without
581- // false positives.
578+ // but no terminal `complete` or `error` event arrived on the wire.
579+ // Tool-pause legs have expectedTerminal=false and never trip this, so
580+ // dashboards can filter on `{ .copilot.sse.terminal_event_missing = true }`
581+ // without false positives.
582582 const terminalEventMissing = opts . expectedTerminal && ! terminalEventSeen
583583
584584 const tracer = getCopilotTracer ( )
You can’t perform that action at this time.
0 commit comments