Skip to content

[Studio 0.1.803-beta] web_search can be called with empty arguments and returns "No query provided" #9709

Description

@chevalroyal

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

  1. Run Unsloth Desktop/Studio 0.1.803-beta.
  2. Load a local GGUF model with Search/tools enabled.
  3. Ask a question that causes the model to use web_search.
  4. On some tool calls, the model emits web_search with empty arguments.
  5. 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:

  1. 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.
  1. 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."
    )
  1. Optionally heal common argument aliases from local models, e.g. q, search_query, search, or text -> query.

  2. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions