Skip to content

feat(web-search): add LangSearch provider and reranking#1893

Open
lucasfelipe24 wants to merge 2 commits into
MoonshotAI:mainfrom
lucasfelipe24:feat/langsearch-web-search
Open

feat(web-search): add LangSearch provider and reranking#1893
lucasfelipe24 wants to merge 2 commits into
MoonshotAI:mainfrom
lucasfelipe24:feat/langsearch-web-search

Conversation

@lucasfelipe24

Copy link
Copy Markdown

Related Issue

Related to #1041

Problem

WebSearch currently depends on Moonshot-managed search credentials, so users of third-party models cannot configure an independent backend. Search results also cannot be optionally reranked across backends.

What changed

  • add experimental LangSearch Web Search support to both agent engines
  • add optional LangSearch semantic reranking for LangSearch or Moonshot search results
  • add TUI and kimi search configuration flows with atomic config.toml persistence
  • add focused tests, a changeset, and synchronized English/Chinese documentation

The feature is gated by langsearch-web-search; Moonshot search remains available when the flag is disabled. Reranking is configured independently and falls back to the original result order if the rerank request fails.

Validation

  • 70 focused CLI/TUI tests passed
  • 15 node SDK configuration tests passed
  • 64 agent-core-v2 auth/web-search tests passed
  • 57 agent-core tests passed (4 skipped)
  • focused type-aware oxlint passed with no errors
  • agent-core-v2 domain-layer lint passed
  • pnpm run sherif passed
  • changeset status passed
  • VitePress docs build passed (existing ES2024/chunk-size warnings only)
  • full repository lint/typecheck/test runs were attempted before rebasing; unrelated existing working-tree and environment failures prevent using them as feature validation

Checklist

  • I have read the CONTRIBUTING document.
  • I have linked a related issue, or explained the problem above.
  • I have added tests that prove my feature works.
  • Ran gen-changesets skill, or this PR needs no changeset.
  • Ran gen-docs skill, or this PR needs no doc update.

@changeset-bot

changeset-bot Bot commented Jul 18, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 7ed2c11

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@moonshot-ai/kimi-code Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1265c49d6b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +175 to +176
if (config.services?.moonshotSearch !== undefined) {
await host.harness.removeService('moonshotSearch');

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve Moonshot as the disabled-flag fallback

When a user configures LangSearch over an existing Moonshot backend, deleting moonshotSearch removes the fallback that both runtime implementations select whenever langsearch-web-search is later disabled. Disabling the experimental flag therefore hides WebSearch entirely instead of reverting to the user's working Moonshot credentials; keep the Moonshot section because LangSearch already takes precedence while enabled.

Useful? React with 👍 / 👎.

Comment on lines +249 to +250
if (config.services?.langsearch !== undefined) {
await host.harness.removeService('langsearch');

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve the API key used by rerank when switching providers

If [services.rerank] omits its own API key, both engines intentionally reuse services.langsearch.apiKey. Switching to Moonshot here deletes that key without updating or removing the independently configured reranker, so subsequent searches silently stop being reranked. Before removing LangSearch, preserve its key in the rerank section or require a dedicated rerank key.

Useful? React with 👍 / 👎.

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.

1 participant