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

Function createSimulatedStreamStart

src/node/services/streamSimulation.ts:42–56  ·  view source on GitHub ↗

Build the common StreamStartEvent used by both simulation paths.

(ctx: SimulationContext)

Source from the content-addressed store, hash-verified

40
41/** Build the common StreamStartEvent used by both simulation paths. */
42function createSimulatedStreamStart(ctx: SimulationContext): StreamStartEvent {
43 return {
44 type: "stream-start",
45 workspaceId: ctx.workspaceId,
46 messageId: ctx.assistantMessageId,
47 model: ctx.canonicalModelString,
48 routedThroughGateway: ctx.routedThroughGateway,
49 ...(ctx.routeProvider != null ? { routeProvider: ctx.routeProvider } : {}),
50 historySequence: ctx.historySequence,
51 startTime: Date.now(),
52 agentId: ctx.effectiveAgentId,
53 ...(ctx.metadataMode != null ? { mode: ctx.metadataMode } : {}),
54 thinkingLevel: ctx.effectiveThinkingLevel,
55 };
56}
57
58// ---------------------------------------------------------------------------
59// forceContextLimitError simulation

Callers 2

simulateToolPolicyNoopFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected