Browse Source

test: mock LLM records system prompt for E2E assertions

Co-authored-by: CodeFree <codefree@chinatelcom.cn>
feat/agent-independence
npmrun 2 months ago
parent
commit
7c4e4b4ba8
  1. 6
      e2e/global-setup.ts

6
e2e/global-setup.ts

@ -53,6 +53,12 @@ function startMockLlm(): Promise<void> {
let parsed: any = {};
try { parsed = JSON.parse(body); } catch { parsed = {}; }
const model = parsed.model || "mock-model";
const systemMsg = Array.isArray(parsed.messages)
? parsed.messages.find((m: any) => m.role === "system")
: undefined;
if (systemMsg?.content) {
(globalThis as any).__lastMockSystemPrompt = systemMsg.content;
}
const chars = Array.from(MOCK_REPLY);
res.writeHead(200, {
"Content-Type": "text/event-stream",

Loading…
Cancel
Save