From 3d4be88d97aba53c7cd1fb5dfc5a9f01fcb0bde0 Mon Sep 17 00:00:00 2001 From: Yansong Zhang <916125788@qq.com> Date: Thu, 9 Apr 2026 12:18:07 +0800 Subject: [PATCH] fix(api): remove unsupported 'user' param from FC/ReAct invoke_llm calls FunctionCallStrategy and ReActStrategy were passing user=self.context.user_id to ModelInstance.invoke_llm() which doesn't accept that parameter. This caused tool-using agent runs to fail with: "ModelInstance.invoke_llm() got an unexpected keyword argument 'user'" Verified: Agent V2 with current_time tool now works end-to-end: ROUND 1: LLM thought -> CALL current_time -> got time ROUND 2: LLM generates answer with time info Made-with: Cursor --- api/core/agent/patterns/function_call.py | 1 - api/core/agent/patterns/react.py | 1 - 2 files changed, 2 deletions(-) diff --git a/api/core/agent/patterns/function_call.py b/api/core/agent/patterns/function_call.py index f4d91de8d2..7d771d7444 100644 --- a/api/core/agent/patterns/function_call.py +++ b/api/core/agent/patterns/function_call.py @@ -92,7 +92,6 @@ class FunctionCallStrategy(AgentPattern): tools=current_tools, stop=stop, stream=stream, - user=self.context.user_id, callbacks=[], ) diff --git a/api/core/agent/patterns/react.py b/api/core/agent/patterns/react.py index 179ccdb734..8a64373a12 100644 --- a/api/core/agent/patterns/react.py +++ b/api/core/agent/patterns/react.py @@ -114,7 +114,6 @@ class ReActStrategy(AgentPattern): model_parameters=model_parameters, stop=stop, stream=stream, - user=self.context.user_id or "", callbacks=[], )