feat: add kimi-web-search builtin extension#10
Open
ckanner wants to merge 2 commits into
Open
Conversation
60039d2 to
7adbe57
Compare
Integrate Kimi Code official SearchWeb/FetchURL services: - SearchWeb: POST /search with text_query, limit, enable_page_crawling - FetchURL: POST /fetch with url, fallback to local HTTP on error - Pass Authorization and X-Msh-Tool-Call-Id headers per Kimi CLI - Configurable via PI_KIMI_WEB_SEARCH, PI_KIMI_SEARCH_BASE_URL, PI_KIMI_FETCH_BASE_URL - Resolves API key via ctx.modelRegistry.getApiKeyAndHeaders() Fixes incorrect anthropic-web-search injection into kimi-coding provider. Registered as builtin extension id 'kimi-web-search'.
Add fork change record explaining: - What kimi-web-search does (SearchWeb/FetchURL for Kimi Code) - Why it was added (Kimi had no web search integration) - Why extension system alone couldn't handle it - Expected merge conflict zones
7adbe57 to
9ce5adc
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #9
This PR adds a new builtin extension
kimi-web-searchthat integrates Kimi Code platform's official SearchWeb and FetchURL services into senpi.Problem
anthropic-web-searchextension incorrectly injects Anthropic-nativeweb_search_20250305into kimi-coding requests (both useapi: "anthropic-messages"), which Kimi API does not supportmoonshot_search/moonshot_fetchtools that should be utilizedSolution
New Files
packages/coding-agent/src/core/extensions/builtin/kimi-web-search/index.ts(278 lines)SearchWebandFetchURLtools viapi.registerTool()Authorization,X-Msh-Tool-Call-Id)PI_KIMI_WEB_SEARCH,PI_KIMI_SEARCH_BASE_URL,PI_KIMI_FETCH_BASE_URLModified Files
packages/coding-agent/src/core/extensions/builtin/index.tskimi-web-searchas builtin extensionpackages/coding-agent/src/core/extensions/changes.mdTesting
SearchWebreturns search results withtext_query,limit,enable_page_crawlingFetchURLfetches web pages with fallback to local HTTPPI_ANTHROPIC_WEB_SEARCH=0to ensure no conflict with anthropic-web-searchChecklist
changes.mdSummary by cubic
Add a built-in
kimi-web-searchextension integrating Kimi Code’s SearchWeb and FetchURL for thekimi-codingprovider, enabling web search and URL fetch via Kimi’s official APIs. Closes #9.New Features
SearchWebandFetchURLtools callinghttps://api.kimi.com/coding/v1/searchand/fetchwithAuthorizationandX-Msh-Tool-Call-Id(includestimeout_seconds: 30).PI_KIMI_WEB_SEARCH,PI_KIMI_SEARCH_BASE_URL,PI_KIMI_FETCH_BASE_URL; falls back to local HTTP fetch on service errors.ctx.modelRegistry.getApiKeyAndHeaders(); exposes results/content to the agent.kimi-web-search.Bug Fixes
web_search_20250305intokimi-codingrequests; uses Kimi services instead.Written for commit 9ce5adc. Summary will update on new commits. Review in cubic