Skip to content

Commit 4e286a2

Browse files
committed
fix(vllm): let tool-loop errors propagate instead of returning silent partial success
1 parent 8988ac7 commit 4e286a2

2 files changed

Lines changed: 181 additions & 189 deletions

File tree

apps/sim/providers/vllm/index.test.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -200,20 +200,20 @@ describe('vllmProvider', () => {
200200
expect(JSON.parse(toolMessage.content)).toMatchObject({ error: true, tool: 'myTool' })
201201
})
202202

203-
it('preserves partial results when a follow-up model call fails mid-loop', async () => {
203+
it('surfaces a ProviderError when a follow-up model call fails mid-loop', async () => {
204204
mockCreate
205205
.mockResolvedValueOnce(chatResponse(null, [toolCall('call_1', 'myTool')]))
206206
.mockRejectedValueOnce(new Error('connection reset'))
207207

208-
const result = await vllmProvider.executeRequest({
209-
model: 'vllm/llama-3',
210-
messages: [{ role: 'user', content: 'go' }],
211-
tools: [makeTool('myTool')],
212-
})
208+
await expect(
209+
vllmProvider.executeRequest({
210+
model: 'vllm/llama-3',
211+
messages: [{ role: 'user', content: 'go' }],
212+
tools: [makeTool('myTool')],
213+
})
214+
).rejects.toThrow('connection reset')
213215

214216
expect(mockExecuteTool).toHaveBeenCalledTimes(1)
215-
expect(result.toolCalls).toHaveLength(1)
216-
expect(result.toolResults).toHaveLength(1)
217217
})
218218

219219
it('cycles forced tools: forces the next forced tool after the first is used', async () => {

0 commit comments

Comments
 (0)