refactor: address code review feedback on MCP tool calling

This commit is contained in:
copilot-swe-agent[bot]
2026-07-25 12:52:42 +00:00
committed by GitHub
parent 76c6086db3
commit 51188fe3bd
3 changed files with 13 additions and 8 deletions
+2 -2
View File
@@ -371,7 +371,7 @@ async def message_handler(update: Update, context: ContextTypes.DEFAULT_TYPE) ->
if tool_client is not None:
reply = await llm.chat_with_tools(text, tool_client, history=call_history)
else:
reply = await llm.chat(text, history=call_history) # type: ignore[arg-type]
reply = await llm.chat(text, history=call_history)
history.append({"role": "user", "content": text})
history.append({"role": "assistant", "content": reply})
else:
@@ -381,7 +381,7 @@ async def message_handler(update: Update, context: ContextTypes.DEFAULT_TYPE) ->
if tool_client is not None:
reply = await llm.chat_with_tools(text, tool_client, history=call_history)
else:
reply = await llm.chat(text, history=call_history) # type: ignore[arg-type]
reply = await llm.chat(text, history=call_history)
user_history.append({"role": "user", "content": text})
user_history.append({"role": "assistant", "content": reply})
if len(user_history) > _MAX_HISTORY * 2: