From 4c0d27aca32e1907aed98b7684c0328d626958b9 Mon Sep 17 00:00:00 2001 From: Hibryda Date: Thu, 12 Mar 2026 07:30:56 +0100 Subject: [PATCH] fix: LLM judge CLI context isolation (--setting-sources user, cwd /tmp) --- v2/tests/e2e/llm-judge.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/v2/tests/e2e/llm-judge.ts b/v2/tests/e2e/llm-judge.ts index 0b1d237..f23ccba 100644 --- a/v2/tests/e2e/llm-judge.ts +++ b/v2/tests/e2e/llm-judge.ts @@ -128,15 +128,17 @@ async function judgeCli( if (!cliPath) throw new Error('Claude CLI not found'); const { system, user } = buildPrompt(criteria, actual, context); - const fullPrompt = `${system}\n\n${user}`; const output = execFileSync(cliPath, [ - '-p', fullPrompt, + '-p', user, '--model', MODEL, '--output-format', 'text', + '--system-prompt', system, + '--setting-sources', 'user', // skip project CLAUDE.md ], { encoding: 'utf-8', timeout: 60_000, + cwd: '/tmp', // avoid loading project CLAUDE.md env: { ...process.env, CLAUDECODE: '' }, maxBuffer: 1024 * 1024, });