MCPcopy Create free account
hub / github.com/simstudioai/sim / mergeResumeLegOutputs

Function mergeResumeLegOutputs

apps/sim/lib/copilot/request/lifecycle/run.ts:306–314  ·  view source on GitHub ↗
(context: StreamingContext, leg: StreamingContext)

Source from the content-addressed store, hash-verified

304// shared context. Child (subagent-lane) legs leave the join scalars empty; only
305// the join-carrying leg (which streams the orchestrator continuation) sets them.
306export function mergeResumeLegOutputs(context: StreamingContext, leg: StreamingContext): void {
307 if (leg.accumulatedContent) context.accumulatedContent += leg.accumulatedContent
308 if (leg.finalAssistantContent) context.finalAssistantContent += leg.finalAssistantContent
309 if (leg.usage) context.usage = leg.usage
310 if (leg.cost) context.cost = leg.cost
311 if (leg.sawMainToolCall) context.sawMainToolCall = true
312 if (leg.wasAborted) context.wasAborted = true
313 if (leg.errors.length > 0) context.errors.push(...leg.errors)
314}
315
316async function waitForToolIds(context: StreamingContext, toolIds: string[]): Promise<void> {
317 const promises: Promise<unknown>[] = []

Callers 2

driveOneChildChainFunction · 0.85

Calls 1

pushMethod · 0.45

Tested by

no test coverage detected