Skip to content

fix(tools): show all web search results, not just the first#172

Open
cashcon57 wants to merge 2 commits into
AtomicBot-ai:mainfrom
cashcon57:fix/web-search-multiple-results
Open

fix(tools): show all web search results, not just the first#172
cashcon57 wants to merge 2 commits into
AtomicBot-ai:mainfrom
cashcon57:fix/web-search-multiple-results

Conversation

@cashcon57

@cashcon57 cashcon57 commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Describe Your Changes

The web search tool only rendered the first result even when the search
returned several (the results list showed one card and the subtitle read
"1 result"). There were actually two stacked limits.

1. Presenter dropped all but the first result. Exa's web_search_exa packs
every result into a single output[0].text block, with results separated by a
--- horizontal rule. The presenter rendered one card per output item, and
parseExaTextEntry only reads the first Title:/URL: in each item, so
everything after the first result was dropped and the count was wrong. This
splits each output item's text on the --- separator before parsing, so every
result becomes its own card. It falls back to the whole string when there is no
separator, so a single result (or the one-result-per-item shape) still works.

I checked several saved searches to confirm the separator is stable: the number
of --- rules is consistently one less than the number of results, so the split
lines up exactly.

2. Renderer capped the display to four. Even with the parser fixed, the
renderer only drew results.slice(0, 4), so a 5 or 10 result search still
showed four cards. It now renders every result inside a fixed-height
(max-h-80) overflow-y-auto container, so the block stays about four cards
tall and you scroll through the rest rather than getting a wall of cards.

With both fixes, searches that returned 5 and 10 results now show all of them
(scrollable) with an accurate count, instead of 1 then 4.

Added unit tests for the presenter (packed block, single result,
one-result-per-item, empty output). Verified end to end in a local dev build:
live Exa searches now render the full, scrollable result list.

Fixes Issues

New Behavior video:

Screen.Recording.2026-07-13.at.1.11.52.PM.mov

Self Checklist

  • Added relevant comments, esp in complex areas (noted why the split is needed on the helper)
  • Updated docs (for bug fixes / features): n/a
  • Created issues for follow-up changes or refactoring needed: n/a

Exa's web_search_exa packs every result into a single output text block,
with results separated by a `---` rule. The presenter rendered one card
per output item and parseExaTextEntry only read the first Title/URL, so
all results after the first were dropped and the count was wrong.

Split each item's text on the separator before parsing so every result
becomes its own card. Falls back to the whole string when there is no
separator, so the one-result-per-item shape still works.
The renderer capped the display to the first four results
(results.slice(0, 4)), so even after the parser fix only four showed.
Render every result, constrained to roughly four cards' height with
vertical scroll, so large result sets stay compact instead of showing a
tall wall of cards.
@Vect0rM

Vect0rM commented Jul 20, 2026

Copy link
Copy Markdown
Collaborator

Thank you for your work on this! We’ve integrated your changes while preserving your commits and authorship, and they are planned to ship in the next Atomic Chat release. We really appreciate your contribution!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Web search only shows the first result (Exa returns all results in one text block)

2 participants