feat(core): prioritize discussion before formal plan approval (#24423)

This commit is contained in:
Jerop Kipruto
2026-04-01 11:55:47 -04:00
committed by GitHub
parent 977ae5eaf4
commit d2f0d9dd2d
7 changed files with 74 additions and 28 deletions
+36 -2
View File
@@ -174,7 +174,8 @@ describe('plan_mode', () => {
params: {
settings,
},
prompt: 'Create a plan for a new login feature.',
prompt:
'I agree with the strategy to use a JWT-based login. Create a plan for a new login feature.',
assert: async (rig, result) => {
await rig.waitForTelemetryReady();
const toolLogs = rig.readToolLogs();
@@ -211,7 +212,7 @@ describe('plan_mode', () => {
'import { sum } from "./mathUtils";\nconsole.log(sum(1, 2));',
},
prompt:
'I want to refactor our math utilities. Move the `sum` function from `src/mathUtils.ts` to a new file `src/basicMath.ts` and update `src/main.ts` to use the new file. Please create a detailed implementation plan first, then execute it.',
'I want to refactor our math utilities. I agree with the strategy to move the `sum` function from `src/mathUtils.ts` to a new file `src/basicMath.ts` and update `src/main.ts`. Please create a detailed implementation plan first, then execute it.',
assert: async (rig, result) => {
const enterPlanCalled = await rig.waitForToolCall('enter_plan_mode');
expect(
@@ -326,4 +327,37 @@ describe('plan_mode', () => {
assertModelHasOutput(result);
},
});
evalTest('USUALLY_PASSES', {
name: 'should not exit plan mode or draft before informal agreement',
approvalMode: ApprovalMode.PLAN,
params: {
settings,
},
prompt: 'I need to build a new login feature. Please plan it.',
assert: async (rig, result) => {
await rig.waitForTelemetryReady();
const toolLogs = rig.readToolLogs();
const exitPlanCall = toolLogs.find(
(log) => log.toolRequest.name === 'exit_plan_mode',
);
expect(
exitPlanCall,
'Should NOT call exit_plan_mode before informal agreement',
).toBeUndefined();
const planWrite = toolLogs.find(
(log) =>
log.toolRequest.name === 'write_file' &&
log.toolRequest.args.includes('/plans/'),
);
expect(
planWrite,
'Should NOT draft the plan file before informal agreement',
).toBeUndefined();
assertModelHasOutput(result);
},
});
});