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
This commit is contained in:
Yansong Zhang 2026-04-09 12:18:07 +08:00
parent 482a004efe
commit 3d4be88d97
2 changed files with 0 additions and 2 deletions

View File

@ -92,7 +92,6 @@ class FunctionCallStrategy(AgentPattern):
tools=current_tools,
stop=stop,
stream=stream,
user=self.context.user_id,
callbacks=[],
)

View File

@ -114,7 +114,6 @@ class ReActStrategy(AgentPattern):
model_parameters=model_parameters,
stop=stop,
stream=stream,
user=self.context.user_id or "",
callbacks=[],
)