Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions apps/sim/lib/copilot/request/go/stream.ts
Original file line number Diff line number Diff line change
Expand Up @@ -571,14 +571,14 @@ function stampSseReadLoopSpan(
const nowWall = Date.now()
const startWall = nowWall - (nowPerf - startPerfMs)

const terminalEventSeen = counters.eventsByType.complete > 0
const terminalEventSeen = counters.eventsByType.complete > 0 || counters.eventsByType.error > 0
// `terminal_event_missing` is the single-attribute dashboard signal
// for the "disappeared response" bug class: the caller considered
// this leg to be the final one (`context.streamComplete === true`)
// but no `complete` event arrived on the wire. Tool-pause legs have
// expectedTerminal=false and never trip this, so dashboards can
// filter on `{ .copilot.sse.terminal_event_missing = true }` without
// false positives.
// but no terminal `complete` or `error` event arrived on the wire.
// Tool-pause legs have expectedTerminal=false and never trip this, so
// dashboards can filter on `{ .copilot.sse.terminal_event_missing = true }`
// without false positives.
const terminalEventMissing = opts.expectedTerminal && !terminalEventSeen

const tracer = getCopilotTracer()
Expand Down
Loading