Repository navigation
Description
Summary
In Unsloth Studio/Desktop 0.1.803-beta, the built-in web_search tool can be emitted with an empty argument object ({}). When this happens, the tool returns:
No query provided.
This can break or stall an agent/search turn even though the user's request clearly contains something to search for.
Why this happens
The current WEB_SEARCH_TOOL schema allows both search-by-query and fetch-by-URL, but declares no required arguments:
"properties": {
"query": {...},
"url": {...},
},
"required": [],Then the execution path calls:
_web_search(
arguments.get("query", ""),
url = arguments.get("url"),
...
)So a model-generated tool call like:
{}is schema-valid and becomes an empty query.
Reproduction
- Run Unsloth Desktop/Studio
0.1.803-beta. - Load a local GGUF model with Search/tools enabled.
- Ask a question that causes the model to use
web_search. - On some tool calls, the model emits
web_searchwith empty arguments. - Studio executes it and returns:
No query provided.
Expected behavior
web_search should never execute with neither a non-empty query nor a non-empty url.
If the model emits an invalid empty call, Studio should return a model-visible recoverable error that explicitly asks it to retry with a query, rather than passing an empty string into the search backend.
Suggested fix
Because web_search supports two modes (query search OR url fetch), simply making query required would break URL fetches. A safer fix would be:
- Express the schema as
query OR url(for example withanyOf/oneOf, if the active tool-calling stack supports it), and/or strengthen the tool description:
Provide either a non-empty `query` to search the web or a non-empty `url` to fetch a page. Never call web_search with empty arguments.
- Add an execution-time guard before
_web_search(...):
query = str(arguments.get("query", "") or "").strip()
url = str(arguments.get("url", "") or "").strip()
if not query and not url:
return (
"Error: web_search requires a non-empty 'query' or 'url'. "
"Retry web_search with a query based on the user's request."
)-
Optionally heal common argument aliases from local models, e.g.
q,search_query,search, ortext->query. -
Add regressions for
{}, whitespace-only query/url, valid query mode, and valid URL mode.
Why this matters
This is especially visible in agentic use because one malformed search call can interrupt an otherwise valid multi-step answer. 0.1.803-beta already improved tool exception propagation/recovery, so validating web_search arguments at the tool boundary would fit that recovery model well.
I searched existing issues for "No query provided", "empty query", and web_search and did not find an existing issue specifically covering this empty-argument schema path.
Activity
Souravrajvi0 commentedon Aug 25, 2026
Opened a PR for this: #9716
Confirmed the repro on the backend web_search with {} (and whitespace-only query/url) was schema-valid and landed in _web_search as an empty query, which returned No query provided.
The fix guards that path in execute_tool / _web_search so we don’t hit the search backend, returns a recoverable error asking the model to retry with a query, and heals common aliases (q, search_query, etc.). URL-only fetch is unchanged