ac4af582301a4e8a29245dbba767eba31334ddf9
2
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
55b5eca055 |
gateway: a provider that searches for some of its models is offered as a searcher, with those models only (01huadalang on Discord)
Reported: 01huadalang has a Command Code plan, but web search offered no
searcher for it, although some of its models (gpt-6-luna) search on
their own. The picker counted a provider only when every model searched,
or when its host was a self-searching API.
Changed (internal/gateway/search.go, search_remote.go):
- partSearcher(p) holds for a provider with no Account and no
self-searching API host whose preset is in searchModels or whose base
host is in searchModelsHosts. modelSearchesAny(p, model) says whether
that model is one that searches.
- searchRank ranks such a provider 4 when one of its available models
searches. searcherReady keeps it. searchableModel offers only the
models that search, never e.g. claude-opus-5-5.
- docs/subsystems/gateway-routing.md says so.
Test: TestCommandCodeSearchesForOtherModels (search_models_test.go).
Broken by hand, each one red, then green when put back:
- search.go and search_remote.go reverted: "the picker offers [],
want Command Code's gpt-6-luna alone".
- partSearcher dropped from searcherReady's keep, and the
searchableModel case dropped: `Command Code searches with
"claude-opus-5-5"`.
Run, go1.26.8 darwin/arm64, sandbox HOME, private GOCACHE:
At this stack on origin/main
|
||
|
|
76f802d37d |
gateway: Command Code's Provider API searches by itself for the 12 models that do, and the rest keep magpie's searcher (#1590, M3chD09)
Command Code's Provider API passes a provider-defined web_search on to the model's vendor, and only some models search: M3chD09 ran all 87 and 12 did (claude-sonnet-5-5 and claude-haiku-5-5 on Messages; gpt-6-luna, gpt-5.6-sol, gpt-5.6-luna, meta/muse-spark-1.2/1.3 and their -contributor ids, xai/grok-4.5/4.6/4.7 on Responses). magpie took the whole provider as one that doesn't search, so each of those searches went to the searcher instead. Marking the provider as searching (Searches, or its host in searchHosts) would have sent the tool to the other 75, which take it and don't search. searchModels now lists, per provider and API, the models that search by themselves; modelSearches reads it for a keyed provider made from the "commandcode" preset or at api.commandcode.ai, and none count when the provider is sent Command Code's x-cmd-zdr header, under which it refuses every built-in tool (cmd_zdr_unsupported_tool, from the report). It is read in searchesModel, so the relay/translate choice and the tool swap both follow it, and in webSearchOf, so a remote magpie's list says "native" for those models too. Sign-ins (the Command Code Plan, its plugin) are not changed. Verified: - TestCommandCodeSearchesForSomeModels: gpt-6-luna and xai/grok-4.7 on Responses and claude-sonnet-5-5 on Messages are sent the agent's own web search tool; deepseek-v4-pro and claude-opus-5-5 aren't; with x-cmd-zdr: 1 none is. Without the searchesModel change it fails for the three searching models. - go test -run Search ./internal/gateway, gofmt -l. - Not tried against the real Command Code API (no key for it here); the list is the reporter's run of 2026-10-11. |