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

Function createSession

src/node/services/agentSession.continueMessageAgentId.test.ts:125–147  ·  view source on GitHub ↗
(messages: MuxMessage[] = [])

Source from the content-addressed store, hash-verified

123 });
124
125 const createSession = async (messages: MuxMessage[] = []) => {
126 const { historyService, cleanup } = await createTestHistoryService();
127 historyCleanup = cleanup;
128 for (const message of messages) {
129 await historyService.appendToHistory("ws", message);
130 }
131
132 const session = new AgentSession({
133 workspaceId: "ws",
134 config: createConfig(),
135 historyService,
136 aiService: createAiService(),
137 initStateManager: createInitStateManager(),
138 backgroundProcessManager: createBackgroundProcessManager(),
139 });
140 sessions.push(session);
141
142 return {
143 session,
144 historyService,
145 internals: session as unknown as SessionInternals,
146 };
147 };
148
149 test("legacy continueMessage.mode does not fall back to compact agent", async () => {
150 let dispatchedMessage: string | undefined;

Calls 7

createTestHistoryServiceFunction · 0.90
appendToHistoryMethod · 0.80
createConfigFunction · 0.70
createAiServiceFunction · 0.70
createInitStateManagerFunction · 0.70
pushMethod · 0.65

Tested by

no test coverage detected