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

Function appendPartialAssistantForTests

src/node/services/streamManager.test.ts:134–149  ·  view source on GitHub ↗
(
  workspaceId: string,
  messageId: string,
  historySequence: number
)

Source from the content-addressed store, hash-verified

132}
133
134async function appendPartialAssistantForTests(
135 workspaceId: string,
136 messageId: string,
137 historySequence: number
138): Promise<void> {
139 const appendResult = await historyService.appendToHistory(workspaceId, {
140 id: messageId,
141 role: "assistant",
142 metadata: { historySequence, partial: true },
143 parts: [],
144 });
145 expect(appendResult.success).toBe(true);
146 if (!appendResult.success) {
147 throw new Error(appendResult.error);
148 }
149}
150
151function createStreamResultForTests(
152 fullStream: AsyncGenerator<unknown, void, unknown>,

Callers 3

processCleanupStreamFunction · 0.85

Calls 1

appendToHistoryMethod · 0.80

Tested by

no test coverage detected