Commit Graph
2 Commits
Author SHA1 Message Date
yetone 50adf78e66 gateway, gui: the web searcher picked in Settings is never handed on to another provider, and one that answered without searching is said so (Gearclickist on Discord)
Cause: Gearclickist picked the Grok subscription's grok-4.7 in Settings ›
Web search. Their grok rows were about 1.3k tokens. That is the size of a
Grok request that ran no search. With the tool and searching, our real
Grok account gives 6k-66k input every time, and /models says
supports_backend_search for all four models. So on their account Grok
answered from what it knew. searchWith read that as "found nothing", and
modelSearch handed the search to the next of Searchers() by rank: Codex's
gpt-6-astra, a pricier subscription model they never picked.

Change:
- modelSearch: a searcher named in Settings gives way to no other
  provider. Its error goes back to the model ("no other provider searches
  in its place"), and webSearch then asks the search APIs, if any are set
  up. Automatic keeps its fallback (#669) with the Routing row that says
  why.
- searchWith tells a reply with no server_tool_use or
  web_search_tool_result (errNotSearched) apart from one that searched and
  named no page (errFoundNothing). CallFor gets notSearched.
- namedFailed/SearcherFailed keep the named searcher's last failed search,
  cleared by its next success or by picking another searcher.
  /api/settings returns it as searchFailed.
- Settings › Web search puts a warning at the start of the row's help
  (before the ellipsis) naming the searcher, when, and why ("answered
  without searching the web, so its account or plan may not offer web
  search"). The help text now says a picked provider is never replaced by
  another provider. The Routing row (kindWhy) says not-searched too.
  zh, zh-TW, ja and de strings added.
- docs/subsystems/gateway-routing.md rewritten for the rule.

Run (worktree on origin/main fd0359233):
- Real Grok account (sandbox, requests only): grok-4.x with the
  web_search tool searched each time (6k-66k input, cache 3456). Without
  it, about 1.3k input, cache 1152, which matches the reporter's rows.
- go test -tags nogui ./internal/gateway ./internal/gui: ok.
- gofmt -l is clean. go vet passes on darwin, GOOS=linux -tags nogui and
  GOOS=windows.
- Broken by hand, the tests go red:
  - Dropping the no-handover rule turns TestPickedSearcherIsNotHandedOn
    and TestSearcherFindingNothingGivesWay red.
  - Dropping the !searched check turns the NotSearched assertions red.
  - Reverting app.js/routing.js turns the new searcher-pick and
    search-instead cases red.
- GUI (playwright 1.62.0), chromium and webkit, every language, widths
  560 and 1000: search-instead, searcher-pick, i18n-keys, settings-search,
  provider-search, search-api, search-first and search-mcp all pass,
  except searcher-pick's "search help preserves ellipsis and hover titles"
  on webkit en/ja/de. That case is red on origin/main too (#1745).

Not run or not changed:
- The reporter's own account wasn't reproducible, so why Grok skipped the
  search there isn't known.
- No change to the Grok plugin or the built-in: supports_backend_search
  is true for every model, so reading it wouldn't have caught this case.
- Not tried on Windows or Linux GUI.
2026-10-13 02:30:53 +08:00
yetone 7639c1d8db gateway, gui: a web search made in place of the picked searcher says in its Routing row which searcher failed or found nothing, and why (Gearclickist on Discord)
Gearclickist picked Grok as the web-search model (代搜). In Codex, a
web_search did go to Grok, but Codex's default search model then searched,
and nothing said why. modelSearch asks the searcher picked in Settings
first. When it errors, or its reply names no page it found, the next of
Searchers() searches in its place (#669, up to three). The first error was
dropped, so the Routing row only showed the model that answered.

Falling back stays. searchingInstead now puts on the search's CallFor the
searcher asked first (instead), whether the user picked it (picked), and
its error (why) or that it found nothing (nothingFound, from a new
errFoundNothing that searchWith and kimiSearch wrap). Routing's kindWhy
says "<grok>, the searcher picked in Settings › Models › Web search,
didn't search for Codex's <model>: <why>. So magpie had <next>, the next
searcher it can use, search in its place." There are 7 new strings, in
zh, zh-TW, ja and de.

Grok itself: magpie's exact search body was sent to real Grok (4 models,
6 queries) through the built-in, and replayed through the plugin. Every
time it answered with pages, so no Grok or plugin cause was found, and
there is no plugin publish or mover min raise. The next time Grok fails
for Gearclickist, the row now names the error.

Run:
- go test ./internal/gateway ./internal/agent -count=1 under a sandbox
  HOME: ok (933s, 720s).
- TestSearchInPlaceOfPickedSaysWhy (found nothing, failed) passes. With
  the searchingInstead call taken out by hand, both subtests go red.
- search-instead.test.cjs: chromium and webkit, en/zh/zh-TW/ja/de, at
  1100 and 520px: 10/10 pass. With kindWhy's new branch turned off by
  hand: red.
- search-mcp, routing-side-calls, provider-search and routing-kind GUI
  tests pass.
- go vet on darwin, GOOS=linux -tags nogui, and GOOS=windows; gofmt -l
  is clean.

Not verified: a real Grok search failing for Gearclickist's account,
since it couldn't be reproduced.
2026-10-12 23:30:08 +08:00