F5: web search/fetch on the Kimi services (kimi-cli parity)
web_search now speaks the Kimi search service (kimi-cli tools/web/search.py,
wire-verified against api.kimi.com):
- POST {coding_base}/search with {text_query, limit 1-20 (default 5),
enable_page_crawling, timeout_seconds: 30}, OAuth bearer +
X-Msh-Tool-Call-Id; results render in kimi-cli's Title/Date/URL/Summary
schema with result URLs as citations.
- The old implementation called the xAI Responses API with a search model;
that client is fully replaced and the entire model-based config surface
is excised root-and-branch: web_search_model config keys/env/CLI plumbing,
resolve_web_search_sampling_config, toolset web_search SamplerConfig,
RemoteSettings.web_search_model, default_web_search_model.
- Enablement is now purely structural: the service exists only on the Kimi
Code subscription channel, so OAuth sessions get Enabled and API-key-only
sessions get Disabled (tool absent) — per PRD F5.
web_fetch gains the Kimi fetch service as its primary path (kimi-cli
tools/web/fetch.py): POST {coding_base}/fetch with {url}, Accept:
text/markdown, OAuth bearer + X-Msh-Tool-Call-Id; the 200 body is the
extracted markdown (still overflow-budgeted). Any service failure falls
back to the existing local pipeline (SSRF guards, cache, extraction).
The tool gate defaults ON now (kimi-cli always offers FetchURL) and the
egress User-Agent no longer claims grok-agent/x.ai.
Verified end-to-end against the scripted mock service: a headless session
drove web_search (limit/crawling/call-id observed on the wire) then
web_fetch (Accept + call-id observed) to completion.
This commit is contained in:
@@ -1284,7 +1284,6 @@ auto_update = true # check for updates on launch
|
||||
|
||||
[models]
|
||||
default = "grok-build" # model used for new sessions
|
||||
web_search = "grok-4.20-multi-agent" # model used by the web_search tool
|
||||
|
||||
[ui]
|
||||
max_thoughts_width = 120 # max column width for reasoning display
|
||||
@@ -1739,23 +1738,6 @@ api_key = "sk-custom"
|
||||
2. Prefetched models from remote `/v1/models`
|
||||
3. Hardcoded defaults — lowest priority
|
||||
|
||||
**Web search model:** Set `[models] web_search`, `KIGI_WEB_SEARCH_MODEL`, or `--web-search-model` to point the `web_search` tool at a different model. The target endpoint must support the Responses API and web search.
|
||||
|
||||
> **Overriding with a custom model:** Setting `[models] web_search` alone is not
|
||||
> enough if the model isn't already in the catalog (built-in defaults or
|
||||
> `grok models` output). You also need a `[model.*]` entry so Grok knows
|
||||
> how to reach it. Without both, web search is silently disabled.
|
||||
>
|
||||
> ```toml
|
||||
> [models]
|
||||
> web_search = "my-custom-model" # 1. tell web search which model to use
|
||||
>
|
||||
> [model.my-custom-model] # 2. tell Grok how to reach it
|
||||
> model = "my-custom-model"
|
||||
> api_backend = "responses" # required — web search uses the Responses API
|
||||
> # base_url, api_key, env_key optional — defaults to cli-chat-proxy
|
||||
> ```
|
||||
|
||||
### Examples
|
||||
|
||||
**OpenAI-compatible endpoint:**
|
||||
|
||||
Reference in New Issue
Block a user