MCPcopy Index your code
hub / github.com/simstudioai/sim / abortActiveStream

Function abortActiveStream

apps/sim/lib/copilot/request/session/abort.ts:281–299  ·  view source on GitHub ↗
(streamId: string)

Source from the content-addressed store, hash-verified

279 * controller" in dashboards.
280 */
281export async function abortActiveStream(streamId: string): Promise<boolean> {
282 return withCopilotSpan(
283 TraceSpan.CopilotChatAbortActiveStream,
284 { [TraceAttr.StreamId]: streamId },
285 async (span) => {
286 await writeAbortMarker(streamId)
287 span.setAttribute(TraceAttr.CopilotAbortMarkerWritten, true)
288 const controller = activeStreams.get(streamId)
289 if (!controller) {
290 span.setAttribute(TraceAttr.CopilotAbortControllerFired, false)
291 return false
292 }
293 controller.abort(AbortReason.UserStop)
294 activeStreams.delete(streamId)
295 span.setAttribute(TraceAttr.CopilotAbortControllerFired, true)
296 return true
297 }
298 )
299}
300
301export type { AbortReasonValue } from './abort-reason'
302/**

Callers 1

route.tsFile · 0.90

Calls 5

withCopilotSpanFunction · 0.90
writeAbortMarkerFunction · 0.90
getMethod · 0.65
abortMethod · 0.65
deleteMethod · 0.65

Tested by

no test coverage detected