-
-
Notifications
You must be signed in to change notification settings - Fork 17.9k
Closed
Description
Bug Description
When the AI calls run_command and passes wait: null (the parameter is optional), the backend serializes Python None as the string "None" in the query string, which fails open-terminal's FastAPI validation with a 422 error.
Steps to Reproduce
- Configure an admin-level open-terminal connection
- Ask the AI to run any shell command via the terminal tool
- The AI calls
run_commandwith{ "command": "uname -a", "wait": null }
Error
HTTP error 422: {"detail":[{"type":"float_parsing","loc":["query","wait"],"msg":"Input should be a valid number, unable to parse string as a number","input":"None"}]}
Root Cause
In open_webui/utils/tools.py, execute_tool_server() builds query params without filtering None values:
# ~line 1249
elif param_in == "query":
query_params[param_name] = params[param_name] # None includedThen serializes them:
query_string = "&".join(f"{k}={v}" for k, v in query_params.items())
# produces: wait=None (the string "None", not omitted)The open-terminal /run_command endpoint declares wait as Optional[float] — a valid null — but FastAPI rejects the literal string "None".
Fix
elif param_in == "query":
if params[param_name] is not None:
query_params[param_name] = params[param_name]Optional parameters with no value should be omitted from the query string entirely.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels