nwhitehouse makes every source visible, even when the AI goes quiet

A small but pointed fix: search results now show up as clickable cards in the chat, whether or not the model bothers to write them up.

searchchat-ui

nwhitehouse's fork now renders every legal and web search result as its own card inside the assistant's reply - title, source, date, snippet, link out. The point is to decouple what the user can see from what the model decides to say about it. When the underlying AI under-explains (and on multi-source research questions it sometimes returns almost nothing at all), the citations are still right there in front of the lawyer.

A follow-up tweak forty-five minutes later caught the real failure mode: the cards were being swept into a collapsed "Completed in N steps" block, hidden behind a disclosure arrow. nwhitehouse broke them back out so they sit alongside the answer by default. A later research mode reverses this again, on the bet that synthesis there is reliable enough not to need the safety net.

So what Anyone deploying smaller or cheaper models for legal research should steal this pattern - the cite list is often more trustworthy than the summary on top of it.

View this fork on GitHub →

Spotted something wrong? Or know the PR text has fresher detail than the writeup above?

Commits in this thread

2 commits from nwhitehouse/mike, oldest first. Source extracted verbatim from the harvested git log.

SHA Subject Author Date
e7f59072 [feat-004] References inline display Nick Whitehouse 2026-05-04 ↗ GitHub
commit body
Surfaces every legal_search and web_search result as a clickable card in
the assistant message, decoupling source-link visibility from Olava's
synthesis. Even when the model under-summarises (which it does because
it's a small reasoning model), the user sees every source and can click
through.

Backend
- chatTools.ts: new ReferenceResult type, accumulated by runToolCalls,
  returned alongside docsRead/docsCreated/etc. legal_search and
  web_search dispatch cases push one ReferenceResult per result and
  emit a "reference_added" SSE event for each (live streaming so cards
  appear as soon as fetched).
- runLLMStream's runTools callback iterates references and pushes
  reference_added events into the assistant message's events array, so
  reloading a chat keeps the cards visible.
- Backend AssistantEvent union extended with reference_added shape.

Frontend
- types.ts: AssistantEvent union extended to mirror the backend shape.
- useAssistantChat.ts: handles reference_added SSE events live.
- AssistantMessage.tsx: new ReferenceBlock card component (title +
  source label + date + snippet, blue dot connector, hover state,
  opens URL in new tab). Dispatch case interleaves cards
  chronologically with content and other tool events.

Same card style works for both legal and web sources - feat-005's
multi-pass orchestrator will produce many of these per turn and they'll
all render with one component.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
3785d7f2 [bug-003] Render references outside the collapsible step wrapper Nick Whitehouse 2026-05-04 ↗ GitHub
commit body
feat-004's reference_added events were getting grouped into the
PreResponseWrapper alongside other tool chatter, which collapses to
"Completed in N steps" by default. References were invisible until the
user expanded the disclosure - which is exactly backwards: references
ARE the answer when Olava under-synthesises (which it does on
multi-source research queries; see Lawyer Tech Misuse Case test where
Olava emitted only "\n\n" three times alongside 11 web references).

Fix: extend the EventGroup discriminated union with a "reference" kind
that breaks the pre-wrapper just like content does. Reference cards
now render inline at top level, never hidden behind a disclosure.

Verified against the chat that motivated the fix - same 11 references
will now render as cards instead of collapsing into "Completed in 5
steps" wrappers. Synthesis quality (Olava emitting empty content) is a
separate problem addressed by feat-005.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

Capture this thread into my fork

Download a single Markdown prompt that tells Claude how to port every commit above into your working tree — adapting paths and structure to match your repo. Run it via claude -p < capture-thread-123.md from inside the repo you want the changes in.

⬇ Download capture-thread-123.md