openhuman icon indicating copy to clipboard operation
openhuman copied to clipboard

Web search stays offered when no provider can answer, so the agent wastes turns on it

Open senamakel opened this issue 2 months ago • 2 comments

Summary

web_search_tool stays in the agent's tool list when no search provider can actually answer. Every call then fails with "Every configured search provider for this request is unavailable right now.", and the agent can keep calling it.

Problem

In the DeepSWE-10 bench run (dswe10-medium-68f2a24efb), web search was offered, and on kombu-single-active-consumer-priority the agent called it three times:

  • At turn 23, looking for prior art.
  • At turn 56, twice in parallel (for get_sac_status and consumer_registry_snapshot), after spotting an ambiguous line in the spec: "Let me try to find any reference implementation online to resolve the get_sac_status return semantics."

All three calls came back with Every configured search provider for this request is unavailable right now. (search/tools.rs, errors::UNAVAILABLE). The agent then guessed, and the guess was the reading the hidden test rejects (see the related issue).

Why the tool is offered anyway: search/providers.rs counts the managed route as reachable whenever a backend credential resolves (backend_credential_available → resolve_backend_credential(config).is_ok()). It never checks that the search backend can actually be reached. In the bench, task containers sit on an internal network whose only route out is the LLM proxy (openhuman-benchmarks 63d11d1, on purpose, so agents cannot download benchmark answers). So no provider is reachable, yet the tool is offered on every turn. The same happens in any deployment that has a credential but no working search: offline, behind a firewall, an expired key, no balance.

Effects:

  • Each failed call wastes a turn, at the very moment the agent is unsure what to do.
  • The error says the providers are unavailable "right now", which suggests retrying later rather than deciding without search.
  • The tool's schema is paid for in every request's prompt even though it can never work.

Solution (optional)

Any of these, roughly from simplest to most complete:

  1. Make the failure final for the session. On UNAVAILABLE (and on auth failures from the managed route), return a message that tells the model to stop, for example: "Web search is not available in this session. Do not call it again; decide from the material you have."
  2. Stop offering it after the first such failure: drop or defer web_search_tool, web_answer_tool and web_contents_tool for the rest of the session. Tools a session has already been sent are recorded in its transcript, so this must work with how sessions restore their tool list.
  3. Only offer search when it can work: register the tools only if a provider is actually reachable, using a cheap probe or the result of the last call, not just because a credential is present.

Acceptance criteria

  • [ ] The agent is told to stop: after a search call fails because no provider is available, the result tells the model not to retry, and a test covers it.
  • [ ] It doesn't keep calling: in a session where search can never work, the agent makes at most one search call (checked by a test or by bench captures).
  • [ ] Working search is unchanged: when a provider is reachable, nothing changes.
  • [ ] Diff coverage ≥ 80% — the implementing PR meets the changed-lines coverage gate.

Related

  • Results and captures: tinyhumansai/openhuman-benchmarks#22.
  • The kombu miss this contributed to: #6990.

senamakel avatar Oct 04 '26 13:10 senamakel

Web search tool stays offered when no provider can answer, causing wasted turns

Labelled priority: p2.

tinysweeper avatar Oct 04 '26 13:10 tinysweeper

Picking this one up. Going with the first two options: the failure now tells the model plainly that search is not available in this session and not to call it again, instead of saying "right now", which reads as an invitation to retry.

The three web tools of a session also share one latch, so once a call comes back with nothing available the rest answer straight away without going out to the module again. Leaving the reachability probe alone — that one changes what gets offered in the first place, and it is a bigger call than this.

obchain avatar Oct 05 '26 08:10 obchain