mirror of
https://github.com/open-webui/computer.git
synced 2026-11-22 21:50:43 -05:00
refac
This commit is contained in:
1 parent
ae35beff4d
commit
2aa1630aee
5 files changed
+70
-9
No files matched your search
@@ -2119,6 +2119,7 @@ async def run_chat_task(
|
||||
|
||||
restart = False
|
||||
pending_calls: list[dict] = [] # Collect tool calls from this response
|
||||
pending_call_ids: set[str] = set()
|
||||
response_reasoning_items: list[dict] = [] # Pair with tool outputs on the next request
|
||||
streamed_reasoning_chars = 0
|
||||
|
||||
@@ -2131,6 +2132,16 @@ async def run_chat_task(
|
||||
|
||||
elif event["type"] == "tool_call":
|
||||
# Collect tool call — don't execute yet
|
||||
call_id = event["call_id"]
|
||||
if call_id in pending_call_ids:
|
||||
logger.warning(
|
||||
"[task %s] ignoring duplicate tool call id=%s name=%s",
|
||||
message_id[:8],
|
||||
call_id,
|
||||
event["name"],
|
||||
)
|
||||
continue
|
||||
pending_call_ids.add(call_id)
|
||||
pending_calls.append(event)
|
||||
|
||||
elif event["type"] in ("output", "reasoning"):
|
||||
|
||||
Reference in new issue
Block a user