fix: LLM judge CLI context isolation (--setting-sources user, cwd /tmp)

This commit is contained in:
Hibryda 2026-03-12 07:30:56 +01:00
parent 78afb0e552
commit 4c0d27aca3

View file

@ -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,
});