From 9aaf28b00e6f3300add1da56e7997c0913a7fe2c Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Sun, 11 Oct 2026 20:21:03 +0200 Subject: [PATCH] Bugfix/required tool call in AI agent (#8136) Fix required tool call in AI agent --- apps/api/src/app/endpoints/ai/ai.service.spec.ts | 3 ++- apps/api/src/app/endpoints/ai/ai.service.ts | 10 ++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/apps/api/src/app/endpoints/ai/ai.service.spec.ts b/apps/api/src/app/endpoints/ai/ai.service.spec.ts index b2bb63addc..25ca009416 100644 --- a/apps/api/src/app/endpoints/ai/ai.service.spec.ts +++ b/apps/api/src/app/endpoints/ai/ai.service.spec.ts @@ -892,7 +892,7 @@ describe('AiService', () => { }); }); - it('Restricts the routing to endpoints with zero data retention, limits the number of steps, requires a tool call in the first step and allows no tool call in the last step', async () => { + it('Restricts the routing to endpoints with zero data retention, disables the reasoning, limits the number of steps, requires a tool call in the first step and allows no tool call in the last step', async () => { mockRowMatches({}); await aiService.getActivitiesFromRows({ @@ -905,6 +905,7 @@ describe('AiService', () => { expect(chat).toHaveBeenCalledWith('agent-model', { provider: { require_parameters: true, zdr: true }, + reasoning: { effort: 'none' }, usage: { include: true } }); diff --git a/apps/api/src/app/endpoints/ai/ai.service.ts b/apps/api/src/app/endpoints/ai/ai.service.ts index 3c30ea8e15..6bd88fc344 100644 --- a/apps/api/src/app/endpoints/ai/ai.service.ts +++ b/apps/api/src/app/endpoints/ai/ai.service.ts @@ -517,10 +517,11 @@ export class AiService { * tools search-asset-profiles and get-accounts of the server of the Model * Context Protocol. The accounts are given without values. The first step * requires a tool call, as a model can give the matches without any tool - * call otherwise. The last step allows no tool call, so that the model - * always gives the matches. An asset match whose asset profile no search - * gave is left out, as the import refuses a symbol which the data source - * cannot resolve. + * call otherwise. The reasoning is disabled, as some models ignore a + * required tool call while they reason. The last step allows no tool call, + * so that the model always gives the matches. An asset match whose asset + * profile no search gave is left out, as the import refuses a symbol which + * the data source cannot resolve. */ private async getRowMatches({ abortSignal, @@ -555,6 +556,7 @@ export class AiService { modelPropertyKey: PROPERTY_OPENROUTER_MODEL_AGENT, settings: { provider: { require_parameters: true, zdr: true }, + reasoning: { effort: 'none' }, usage: { include: true } } }),