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:
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_search with empty arguments.
- Studio executes it and returns:
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 with anyOf / 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, or text -> 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.
Summary
In Unsloth Studio/Desktop
0.1.803-beta, the built-inweb_searchtool can be emitted with an empty argument object ({}). When this happens, the tool returns: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_TOOLschema allows both search-by-query and fetch-by-URL, but declares no required arguments:Then the execution path calls:
So a model-generated tool call like:
{}is schema-valid and becomes an empty query.
Reproduction
0.1.803-beta.web_search.web_searchwith empty arguments.Expected behavior
web_searchshould never execute with neither a non-emptyquerynor a non-emptyurl.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_searchsupports two modes (querysearch ORurlfetch), simply makingqueryrequired would break URL fetches. A safer fix would be:query OR url(for example withanyOf/oneOf, if the active tool-calling stack supports it), and/or strengthen the tool description:_web_search(...):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-betaalready improved tool exception propagation/recovery, so validatingweb_searcharguments at the tool boundary would fit that recovery model well.I searched existing issues for
"No query provided","empty query", andweb_searchand did not find an existing issue specifically covering this empty-argument schema path.