Skip to content

Commit 253e664

Browse files
Fix parallel tool call handling in test utils
1 parent 17be383 commit 253e664

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tests/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ async def run_llm_tool_loop(
9090
response = await acompletion(model=model, messages=messages, tools=tools)
9191

9292
while response.choices and response.choices[0].message.tool_calls:
93+
messages.append(response.choices[0].message)
9394
for tool_call in response.choices[0].message.tool_calls:
9495
tool_name = tool_call.function.name
9596
args = (
@@ -101,7 +102,6 @@ async def run_llm_tool_loop(
101102
mcp_client, tool_name, args
102103
)
103104
tools_called.append(mcp_tc)
104-
messages.append(response.choices[0].message)
105105
messages.append(
106106
Message(role="tool", tool_call_id=tool_call.id, content=result_text)
107107
)

0 commit comments

Comments
 (0)