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

Function handleSuccess

apps/sim/lib/copilot/request/lifecycle/finalize.ts:164–179  ·  view source on GitHub ↗
(
  publisher: StreamWriter,
  runId: string,
  requestId: string
)

Source from the content-addressed store, hash-verified

162}
163
164async function handleSuccess(
165 publisher: StreamWriter,
166 runId: string,
167 requestId: string
168): Promise<void> {
169 if (!publisher.sawComplete) {
170 await publisher.publish({
171 type: MothershipStreamV1EventType.complete,
172 payload: { status: MothershipStreamV1CompletionStatus.complete },
173 })
174 }
175 await publisher.flush()
176 await loggedRunStatusUpdate(runId, MothershipStreamV1CompletionStatus.complete, requestId, {
177 completedAt: new Date(),
178 })
179}
180
181async function loggedRunStatusUpdate(
182 runId: string,

Callers 1

finalizeStreamFunction · 0.85

Calls 3

loggedRunStatusUpdateFunction · 0.85
publishMethod · 0.65
flushMethod · 0.45

Tested by

no test coverage detected