mirror of
https://github.com/open-webui/open-webui.git
synced 2026-10-05 02:41:34 +00:00
fix: foreground sub-agents cannot use personal tool servers like Open Terminal (#31424)
With a personal tool server connection such as Open Terminal, the main model could call its tools but a foreground sub-agent it delegated to got none of them. Chats resuming after a tool approval lost those tools the same way. Setting up the tools for the main model emptied the list those later steps read from. It now works on a copy, so sub-agents and resumed chats get the same tools as the parent. Fixes #29893
This commit is contained in:
parent
e26b2edaa4
commit
5d4f9b957e
1 changed files with 2 additions and 0 deletions
|
|
@ -3039,6 +3039,8 @@ async def process_chat_payload(request, form_data, user, metadata, model):
|
|||
for tool_server in direct_tool_servers:
|
||||
if tool_server.get('is_terminal') is True and not terminal_capability:
|
||||
continue
|
||||
# Copy so the pops below keep metadata intact for sub-agents and approval resumes
|
||||
tool_server = dict(tool_server)
|
||||
system_prompt = tool_server.pop('system_prompt', None)
|
||||
if system_prompt:
|
||||
form_data['messages'] = add_or_update_system_message(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue