MCPcopy
hub / github.com/coder/mux / processCleanupStream

Function processCleanupStream

src/node/services/streamManager.test.ts:1031–1061  ·  view source on GitHub ↗
(params: {
    workspaceId: string;
    messageId: string;
    model: LanguageModel;
    streamInfoOverrides?: Record<string, unknown>;
  })

Source from the content-addressed store, hash-verified

1029 }
1030
1031 async function processCleanupStream(params: {
1032 workspaceId: string;
1033 messageId: string;
1034 model: LanguageModel;
1035 streamInfoOverrides?: Record<string, unknown>;
1036 }): Promise<void> {
1037 const streamManager = new StreamManager(historyService);
1038 streamManager.on("error", () => undefined);
1039 const historySequence = 1;
1040
1041 await appendPartialAssistantForTests(params.workspaceId, params.messageId, historySequence);
1042
1043 const streamInfo = createStreamInfoForTests({
1044 messageId: params.messageId,
1045 token: `${params.messageId}-token`,
1046 model: "openai:gpt-4.1-mini",
1047 metadataModel: "openai:gpt-4.1-mini",
1048 historySequence,
1049 request: { model: params.model, messages: [], providerOptions: undefined },
1050 runtime,
1051 ...params.streamInfoOverrides,
1052 });
1053 getWorkspaceStreamsForTests(streamManager).set(params.workspaceId, streamInfo);
1054
1055 await getProcessStreamWithCleanupForTests(streamManager).call(
1056 streamManager,
1057 params.workspaceId,
1058 streamInfo,
1059 historySequence
1060 );
1061 }
1062
1063 const cleanupLifecycleCases: Array<{
1064 name: string;

Callers 1

Calls 6

createStreamInfoForTestsFunction · 0.85
onMethod · 0.80
setMethod · 0.80

Tested by

no test coverage detected