MCPcopy
hub / github.com/simstudioai/sim / completeLoggingSession

Function completeLoggingSession

apps/sim/lib/workflows/streaming/streaming.ts:332–348  ·  view source on GitHub ↗
(result: ExecutionResult)

Source from the content-addressed store, hash-verified

330}
331
332async function completeLoggingSession(result: ExecutionResult): Promise<void> {
333 if (!result._streamingMetadata?.loggingSession) {
334 return
335 }
336
337 const { traceSpans, totalDuration } = buildTraceSpans(result)
338
339 await result._streamingMetadata.loggingSession.safeComplete({
340 endedAt: new Date().toISOString(),
341 totalDurationMs: totalDuration || 0,
342 finalOutput: result.output || {},
343 traceSpans: (traceSpans || []) as any,
344 workflowInput: result._streamingMetadata.processedInput,
345 })
346
347 result._streamingMetadata = undefined
348}
349
350export async function createStreamingResponse(
351 options: StreamingResponseOptions

Callers 1

startFunction · 0.85

Calls 2

buildTraceSpansFunction · 0.90
safeCompleteMethod · 0.80

Tested by

no test coverage detected