feat(plan): refactor TestRig and eval helper to support configurable approval modes (#17171)

This commit is contained in:
Jerop Kipruto
2026-01-21 10:43:48 -05:00
committed by GitHub
parent 0605e6e3e9
commit c21c297133
4 changed files with 26 additions and 22 deletions

View File

@@ -59,7 +59,10 @@ export function evalTest(policy: EvalPolicy, evalCase: EvalCase) {
execSync('git commit --allow-empty -m "Initial commit"', execOptions);
}
const result = await rig.run({ args: evalCase.prompt });
const result = await rig.run({
args: evalCase.prompt,
approvalMode: evalCase.approvalMode ?? 'yolo',
});
const unauthorizedErrorPrefix =
createUnauthorizedToolError('').split("'")[0];
@@ -91,6 +94,7 @@ export interface EvalCase {
params?: Record<string, any>;
prompt: string;
files?: Record<string, string>;
approvalMode?: 'default' | 'auto_edit' | 'yolo' | 'plan';
assert: (rig: TestRig, result: string) => Promise<void>;
}