Skip to content

Commit 61ecacd

Browse files
committed
fix: differentiate manual vs auto-execution in tool tests
- Use execute: false for test checking getToolCalls() to prevent auto-execution - Keep execute: async for test checking getNewMessagesStream() output - Both tests use anthropic/claude-sonnet-4.5 with toolChoice: required - Resolves issue where getToolCalls() returned empty after auto-execution
1 parent 701fe67 commit 61ecacd

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

tests/e2e/call-model.test.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -117,12 +117,8 @@ describe('callModel E2E Tests', () => {
117117
temperature: z.number(),
118118
condition: z.string(),
119119
}),
120-
execute: async (_params) => {
121-
return {
122-
temperature: 22,
123-
condition: 'Sunny',
124-
};
125-
},
120+
// Don't auto-execute so we can test getToolCalls()
121+
execute: false,
126122
},
127123
},
128124
],
@@ -597,10 +593,13 @@ describe('callModel E2E Tests', () => {
597593
temperature: z.number(),
598594
condition: z.string(),
599595
}),
600-
execute: async (_params) => {
596+
// Enable auto-execution so we test the full flow
597+
execute: async (params) => {
598+
// Return weather data that will be yielded
601599
return {
602600
temperature: 22,
603601
condition: 'Sunny',
602+
location: params.location,
604603
};
605604
},
606605
},

0 commit comments

Comments
 (0)