Skip to content

Extend provider-native web search to DeepSeek, Qwen, Kimi, Z.AI/BigModel, and MiMo #5681

Description

@h3c-hexin

Problem

CodeWhale already has a provider-native web-search backend for exact direct
OpenAI, Anthropic, and xAI routes. Users of documented first-party DeepSeek,
Alibaba ModelStudio/Qwen, Moonshot/Kimi, Z.AI/BigModel, and Xiaomi MiMo routes
still fall through to separately configured search backends even when their
active provider account includes native web search.

These providers do not share one wire contract. Treating an OpenAI-compatible
transport as proof of search support risks sending unsupported requests or
credentials to custom and neighboring endpoints.

Proposed solution

Extend the existing provider-native backend with:

  • sourced, three-state capability facts;
  • exact provider, model, product, and endpoint gates;
  • narrow adapters for each documented provider contract;
  • fail-closed behavior for aliases, aggregators, custom gateways, local models,
    coding-only plans, and neighboring endpoint paths;
  • the existing provider-native -> configured/local -> fallback receipt chain;
  • domain constraints applied before deciding that an attempt succeeded;
  • removal of provider-generated answers whenever returned citations violate or
    cannot prove the requested domain constraint;
  • independent bounded deadlines for provider-native and configured/local search;
  • bounded Kimi Formula rounds and total official-tool calls.

Intended slices

  1. Shared domain-filter and fallback-budget correctness fixes.
  2. DeepSeek Responses native search.
  3. Alibaba ModelStudio Token Plan/Qwen native search.
  4. Z.AI global and BigModel China structured search.
  5. Moonshot/Kimi direct API, Kimi Code, and K3 Formula search.
  6. Xiaomi MiMo native search.

Each implementation PR should use Refs #... (partial) until the tracker is
fully satisfied.

Use case

A user who already selected an exact first-party cloud model should be able to
use that provider's included web-search capability first, while retaining the
configured/local backend as an explicit fallback. A compatible gateway, local
model, or adjacent product endpoint must not inherit that capability.

Acceptance criteria

  • Only documented first-party route/model combinations report support.
  • Custom endpoints and nearby product paths remain unknown and perform no
    provider-native request.
  • Provider-native failure or zero usable constrained results fall back with
    a complete receipt.
  • Domain filtering never exposes an answer synthesized from removed sources.
  • Unused provider-native time does not extend the configured/local timeout.
  • Multi-round provider tools have explicit round and total-call limits.
  • Offline deterministic tests cover request shape, parsing, endpoint gates,
    constraints, fallback receipts, and timeout boundaries.
  • Live verification is recorded only for routes with available credentials;
    mock-only routes are disclosed explicitly.
  • No credentials or account identifiers enter fixtures, logs, commits, or
    PRs.

Provider documentation

Alternatives considered

  • Always use configured/local search: reliable as a fallback, but it wastes an
    included provider capability and may require another account.
  • Infer support from OpenAI compatibility: rejected because these provider
    products expose different search protocols.
  • Submit every provider in one implementation PR: rejected because it mixes
    independent wire contracts and obscures live-verification gaps.

Impact

This gives direct-provider users higher-quality regional search without removing
or weakening configurable local backends. It also reduces downstream fork debt
by keeping reusable provider behavior in the engine.

Out of scope

  • Custom or OpenAI-compatible gateways without provider-owned documentation.
  • Local-model web search.
  • New authentication flows.
  • Mandatory live-provider credentials in CI.
  • Gemini support; it should be handled separately on the current Google-provider
    architecture.

Related

Implementation PRs

These boxes track merged slices. Mock-only and live-verification boundaries are
recorded in each PR rather than inferred from CI.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestweb-searchWeb search tool, search backends, result parsing, and browser/fetch search UX

    Projects

    Status
    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions