MCPcopy Index your code
hub / github.com/coder/mux / emitCompletedStreamWithOneTool

Function emitCompletedStreamWithOneTool

src/node/services/sessionTimingService.test.ts:217–232  ·  view source on GitHub ↗
(
    params: {
      workspaceId?: string;
      messageId?: string;
      model?: string;
      startTime?: number;
      duration?: number;
      reasoningTokens?: number;
    } = {}
  )

Source from the content-addressed store, hash-verified

215 }
216
217 function emitCompletedStreamWithOneTool(
218 params: {
219 workspaceId?: string;
220 messageId?: string;
221 model?: string;
222 startTime?: number;
223 duration?: number;
224 reasoningTokens?: number;
225 } = {}
226 ): void {
227 const startTime = params.startTime ?? 1_000_000;
228 emitStreamStart({ ...params, startTime });
229 emitStreamDelta({ ...params, timestamp: startTime + 1000 });
230 emitToolCall({ ...params, startTimestamp: startTime + 2000, endTimestamp: startTime + 3000 });
231 emitStreamEnd(params);
232 }
233
234 describe("rollUpTimingIntoParent", () => {
235 it("should roll up child timing into parent without changing parent's lastRequest", async () => {

Callers 1

Calls 4

emitStreamStartFunction · 0.85
emitStreamDeltaFunction · 0.85
emitToolCallFunction · 0.85
emitStreamEndFunction · 0.70

Tested by

no test coverage detected