8000 Widgets (#317) PR 7: widgets in Combined Search by daoudclarke · Pull Request #663 · mwmbl/mwmbl · GitHub
[go: up one dir, main page]

Skip to content

Widgets (#317) PR 7: widgets in Combined Search - #663

Merged
daoudclarke merged 2 commits into
claude/issue-317-pr6from
claude/sleepy-wozniak-kzylzy
Nov 15, 2026
Merged

daoudclarke merged 2 commits into
claude/issue-317-pr6from
claude/sleepy-wozniak-kzylzy

Conversation

@daoudclarke
Copy link
Copy Markdown
Contributor

What

Combined Search (/api/v2/combined-search/) now fills widgets the same way /api/v2/search/ does.

  • Widget stubs. WidgetFinder.find runs in a thread next to the index retrieval and the Staan fetch, so it adds no latency. init_router now takes the tiny_index and loads the specs at startup, as v2 does.
  • Calculator. An arithmetic query such as 164*8 returns a calculation widget and the results for "calculator". Those results come from a shared CalculatorResults over the combined ranker, ranked once an hour.
    • The request is billed as a search.
    • Staan is not called, nothing is written to the index, and crawl and images are ignored. None of that work would be for the query the user typed.
  • The endpoint description documents both.

Why

Combined Search is meant to replace Super Search and shares v2's response shape, so clients should get the same widgets from either endpoint.

Review

A subagent reviewed the change: code, security, trust and safety, and holistic.

  • In the first version, arithmetic ran the whole pipeline for "calculator": an EUSP call, an index write-back, images and a seed crawl. The second commit fixes that.
  • Trust and safety: low risk. Widget lookup only reads the index, and the calculator path writes nothing.
  • find in a thread is safe: index reads use offsets, and the finder is immutable.

Verification

  • make check: ruff passes, and ty shows nothing new in the changed files.
  • make test: 2138 passed, 10 skipped, before the follow-up commit. After it, the combined search, OpenAPI and widget tests pass (232).
  • New tests in test/test_combined_search.py:
    • triggered stubs reach the response, and the finder gets the query and the index;
    • a query with no trigger word gets no widgets;
    • arithmetic with crawl=true&images=true returns the calculation and the calculator results, is billed, and calls nothing but the ranker's search.

Part of #317. Stacked on #658.


Generated by Claude Code

Combined Search now fills `widgets` like /api/v2/search/: widget stubs the
query triggers, looked up alongside the index retrieval and Staan, and the
calculator for arithmetic, which is then searched as "calculator".

No functional changes to the crawler.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DTbu4n4rmxkjADVxDX41kb
…317)

Review found the arithmetic path ran the whole pipeline for "calculator":
an EUSP call, an index write, images and a seed crawl for a query nobody
typed. Like v2 search, it now returns the calculator results, ranked once
an hour, and skips all of that.

No functional changes to the crawler.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DTbu4n4rmxkjADVxDX41kb
@daoudclarke
daoudclarke added this pull request to stack #659 November 15, 2026 15:20
@daoudclarke
daoudclarke merged commit 71dcf5a into main Nov 15, 2026
6 checks passed
@daoudclarke
daoudclarke deleted the claude/sleepy-wozniak-kzylzy branch November 15, 2026 15:22
@codecov
codecov Bot commented Nov 15, 2026
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

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.

2 participants

0