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'); if (!cliPath) throw new Error('Claude CLI not found');
const { system, user } = buildPrompt(criteria, actual, context); const { system, user } = buildPrompt(criteria, actual, context);
const fullPrompt = `${system}\n\n${user}`;
const output = execFileSync(cliPath, [ const output = execFileSync(cliPath, [
'-p', fullPrompt, '-p', user,
'--model', MODEL, '--model', MODEL,
'--output-format', 'text', '--output-format', 'text',
'--system-prompt', system,
'--setting-sources', 'user', // skip project CLAUDE.md
], { ], {
encoding: 'utf-8', encoding: 'utf-8',
timeout: 60_000, timeout: 60_000,
cwd: '/tmp', // avoid loading project CLAUDE.md
env: { ...process.env, CLAUDECODE: '' }, env: { ...process.env, CLAUDECODE: '' },
maxBuffer: 1024 * 1024, maxBuffer: 1024 * 1024,
}); });