fix: constrain Pascal tools after initial inspection

This commit is contained in:
134 2026-07-12 10:35:55 +08:00
parent ab657330ea
commit 16bfd0bd38
2 changed files with 3 additions and 3 deletions

View File

@ -34,13 +34,13 @@ describe('Pascal agent intent', () => {
).toBe(false) ).toBe(false)
}) })
test('forces a mutation after two inspection steps', () => { test('forces a mutation after the first inspection step', () => {
expect( expect(
pascalAgentStepPolicy({ pascalAgentStepPolicy({
hasMutation: false, hasMutation: false,
mutationRequired: true, mutationRequired: true,
mutationToolNames: ['create_room', 'add_door'], mutationToolNames: ['create_room', 'add_door'],
stepNumber: 2, stepNumber: 1,
}), }),
).toEqual({ ).toEqual({
activeTools: ['create_room', 'add_door'], activeTools: ['create_room', 'add_door'],

View File

@ -34,7 +34,7 @@ export function pascalAgentStepPolicy(params: {
stepNumber: number stepNumber: number
}): { activeTools?: string[]; toolChoice: 'auto' | 'required' } { }): { activeTools?: string[]; toolChoice: 'auto' | 'required' } {
if (!(params.mutationRequired && !params.hasMutation)) return { toolChoice: 'auto' } if (!(params.mutationRequired && !params.hasMutation)) return { toolChoice: 'auto' }
if (params.stepNumber < 2) return { toolChoice: 'required' } if (params.stepNumber < 1) return { toolChoice: 'required' }
return { return {
activeTools: params.mutationToolNames, activeTools: params.mutationToolNames,
toolChoice: 'required', toolChoice: 'required',