Skip to content

bug(search): web_search results carry no snippet — the model can only list links, and the prompt never advertises fetch_full #21877

Closed

Description

@mrveiss

Summary

In a live chat on the local install (2026-11-19, deployed commit f98f24e811) the user asked "what's the weather in Riga?". A locally served model called web_search once, then respond. The answer listed four weather sites and contained no weather data.

The model had nothing else to work with: every search result reached it as title + URL only.

Evidence

Observed (live): the web_search call returned 5 results; all 5 had an empty snippet.

Observed (code, origin/main at f98f24e811):

Where What
autobot-browser-worker/playwright-server.js:436 const snippet = ''; — the result loop reads the title and the href and hardcodes the snippet to the empty string. Unchanged since cbc60ebccd (2025-08-15).
autobot-backend/resources/prompts/chat/system_prompt.md:102 The web_search parameter list names only query.
autobot-backend/chat_workflow/tool_handler.py:226 and :2434 fetch_full exists in the tool schema and is honoured by the handler, but the prompt never mentions it, so the model cannot know to ask for page content.

Inferred, not verified: no search provider is configured on this install, so the search fell back to scraping a search engine's result page through the browser worker. This is read off the log line emitted at autobot-backend/services/playwright_service.py:161; the provider configuration itself was not inspected.

Impact

Any question whose answer normally sits in a result snippet (weather, a price, an opening time, a date) produces a list of links instead of an answer. The model is not at fault: it is given no content.

Fix

  1. Extract the result snippet in the browser worker instead of hardcoding ''.
  2. Advertise fetch_full to the model — preferably by generating the web_search parameter list in the prompt from the tool schema, so the prompt and the schema cannot drift again (same defect class as bug(chat): the chat system prompt never mentions the page-reading tools — three hand-written browser tool lists, none generated from the tool catalogue #21772).

Acceptance criteria

  • The browser-worker search path returns a non-empty snippet for results whose result block has one; a test pins this against a fixture result page.
  • A result with no snippet element still returns (empty snippet, no exception).
  • The chat system prompt lists every web_search parameter the tool schema declares, including fetch_full, and a test fails when the two diverge.
  • Host evidence: the same question on the local install returns an answer containing weather data, not only links.

Related

Activity

  1. github-actions commented on Nov 19, 2026

    @github-actions
    Contributor

    Landed in #21888, merge f559d8c0a7

  2. mrveiss commented on Nov 19, 2026

    @mrveiss
    OwnerAuthor

    AC check against main at f559d8c0a7 (merge of #21888). Three of four ACs have code evidence. This stays open for the host AC. #21888 is not deployed.

    AC (verbatim) Evidence on origin/main Ticked
    "The browser-worker search path returns a non-empty snippet for results whose result block has one; a test pins this against a fixture result page." autobot-browser-worker/search-snippet.js:31 extractSnippet, called per result at playwright-server.js:437 and returned as snippet (:443). Test the snippet is read from the ${name} result layout (tests/search-snippet.test.js:25) runs over fixtures for the three result layouts the worker scrapes (:18-22). The fixtures are result blocks, not a whole saved page ✅
    "A result with no snippet element still returns (empty snippet, no exception)." search-snippet.js:38 catch path. Tests a result with no snippet element gives an empty snippet, not an exception (:30) and a snippet element that cannot be read gives an empty snippet (:34) ✅
    "The chat system prompt lists every web_search parameter the tool schema declares, including fetch_full, and a test fails when the two diverge." Both prompts render {{ web_search_parameters }} (system_prompt.md:102, system_prompt_simple.md:87) from WEB_SEARCH_SCHEMA (web_search_schema.py, fetch_full at :16). Tests test_both_prompts_list_every_web_search_parameter_the_schema_declares (tests/test_browser_tool_prompt.py:91), test_a_parameter_added_to_the_schema_reaches_both_prompts_without_a_prompt_edit (:99), test_no_web_search_parameter_is_hand_written_in_the_prompt_files (:115) ✅
    "Host evidence: the same question on the local install returns an answer containing weather data, not only links." Needs host evidence after deploy. ❌

    Remaining: the host check after #21888 is deployed. Ticked 3 of 4.

  3. mrveiss commented on Nov 20, 2026

    @mrveiss
    OwnerAuthor

    Deploy status, 2026-11-20: the local install now runs 13685f3999, which is current main. It includes the merges of #21749 (80870f228d) and #21888 (f559d8c0a7), verified with git merge-base --is-ancestor.

    Host evidence: none gathered yet. The live chat check is paused until the owner decides how the test logs in, because credentials come only from the secrets manager. No AC is ticked from this deploy.
    Remaining: host evidence that web_search results carry snippets on the live install.

  4. mrveiss commented on Nov 20, 2026

    @mrveiss
    OwnerAuthor

    Live check on the local install at 13685f3999, 2026-11-20 21:26–21:35 Riga. One chat session, two turns: navigate to a weather page, then web_search.

    Host AC not ticked. I asked a different question from the one in the AC, so this is supporting evidence only:

    • web_search output carried snippets. Example: result 1, "Status of Python versions … The main branch is currently the future Python 3.16 …".
    • The answer gave data, not only links: "The latest stable Python release is Python 3.15.2 … Source: https://www.python.org/downloads/latest/".

    Remaining: rerun the AC's weather question through web_search.

  5. mrveiss commented on Nov 21, 2026

    @mrveiss
    OwnerAuthor

    Live check on the local install at 7657af8cb986 (includes #21911, not #21954), 2026-11-21 11:13–11:16 Riga, chat 46a8048a.

    • web_search answered "latest stable Python release" with Python 3.15.2 and the source link python.org/downloads/latest, so the snippets now reach the model. Tool web_search: SUCCESS (1.99s).
    • Host AC not ticked: it names the weather question, and this run asked about Python instead. The weather question should be re-run.
  6. mrveiss commented on Nov 21, 2026

    @mrveiss
    OwnerAuthor

    Live check on the local install at 51c5988f2a3c (includes #21954), 2026-11-21 16:07–16:15 Riga, chat c02e2454. Host AC ticked. "Search the web for the current weather in Riga…" called web_search (returned 16:12:00). The answer was "Temperature: 34°F (1°C) to 36°F (2°C) Conditions: Overcast", which is weather data, not only links. All criteria are ticked, so I'm closing this. The duplicate reply in the same turn (a raw respond TOOL_CALL entry stored next to the answer) is tracked in #21880.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions