From 7c4e4b4ba8ec3223c2d1a08463a712ae8b29e8e7 Mon Sep 17 00:00:00 2001 From: npmrun <1549469775@qq.com> Date: Sun, 9 Aug 2026 11:17:26 +0800 Subject: [PATCH] test: mock LLM records system prompt for E2E assertions Co-authored-by: CodeFree --- e2e/global-setup.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/e2e/global-setup.ts b/e2e/global-setup.ts index 6fda3df..f4c958e 100644 --- a/e2e/global-setup.ts +++ b/e2e/global-setup.ts @@ -53,6 +53,12 @@ function startMockLlm(): Promise { 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",