Skip to content

feat(web): add Xiaomi MiMo native search (rescue of #5687) - #5693

Merged
Hmbown merged 3 commits into
mainfrom
codex/v0912-mimo-native-search-5687-20260828
Aug 28, 2026
Merged

feat(web): add Xiaomi MiMo native search (rescue of #5687)#5693
Hmbown merged 3 commits into
mainfrom
codex/v0912-mimo-native-search-5687-20260828

Conversation

@Hmbown

@Hmbown Hmbown commented Aug 28, 2026

Copy link
Copy Markdown
Owner

Summary

Reconciliation notes: the adapter gate now admits Openai, Anthropic, Xai, XiaomiMimo, Zai, ModelStudio Token Plan, DeepSeek, and DeepSeek-CN together; route capability arms and tests from all four sibling slices coexist; changelog entries retained and regenerated in sync.

No-Issue: partial delivery tracked by #5681; this slice must not close the umbrella issue.
Supersedes #5687 (which stays credited to h3c-hexin).

h3c-hexin and others added 3 commits August 28, 2026 16:44
Signed-off-by: hexin <372726039@qq.com>
Signed-off-by: hexin <372726039@qq.com>
Signed-off-by: CodeWhale Bot <bot@codewhale.net>

# Conflicts:
#	CHANGELOG.md
#	crates/config/src/route/capabilities.rs
#	crates/config/src/route/tests.rs
#	crates/tui/CHANGELOG.md
#	crates/tui/src/client/provider_native_search.rs
@claude

claude Bot commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Claude finished @Hmbown's task in 1m 32s —— View job


Reviewing PR #5693

  • Gather context (diff, changed files)
  • Review correctness / provider-route safety
  • Review reuse, tests, security
  • Post final review

Review

Reviewed git diff origin/main...HEAD (148/-1 across the 6 listed files). This is a well-scoped, mechanical adapter addition that mirrors the already-landed xAI/Z.AI/DeepSeek native-search adapters.

Correctness — no issues found.

  • crates/tui/src/client/provider_native_search.rs: ApiProvider::XiaomiMimo is added consistently to every match site (new() gate, body builder, URL builder, response parser) — all three match arms stay exhaustive with the existing _ => bail!/unreachable! fallbacks, so no silent no-op branch was introduced.
  • build_mimo_search_body doesn't forward request.domains into the payload, unlike the OpenAI/xAI/Anthropic builders — but this is safe: maximum_domain_count() (provider_native_search.rs:96-102) returns Some(0) for MiMo (falls into the _ arm), and tools/web/backend.rs:351-356 rejects any request with domains.len() > maximum before search() is ever called. So a non-empty domain list can't reach this builder silently dropped.
  • parse_mimo_search reuses the existing citation_from_url/push_citation/bounded_answer helpers, so URL-scheme validation (http/https only, non-empty host) and citation dedup apply to MiMo the same as every other adapter — no new parsing surface to audit.

Provider/model/route safety (EPIC #2608 invariant) — good.

  • Gating is exact match, not prefix inference: documented_server_side_web_search("xiaomi-mimo", wire_model_id) (crates/config/src/route/capabilities.rs:84) only returns Supported for the literal strings mimo-v2.5-pro / mimo-v2.5.
  • The new test mimo_native_search_is_exact_to_documented_chat_models (crates/config/src/route/tests.rs) correctly asserts fail-closed (Unknown) behavior for both a neighboring model (mimo-v2.5-pro-ultraspeed) and a custom-compatible base URL override — matching the established pattern from the xAI/Z.AI sibling tests.
  • Capability check happens before the client is even constructed (core/engine.rs:5888 gates on route.capabilities.server_side_web_search.is_supported()), so there's no path where a provider-prefixed model string alone triggers the native-search adapter.

Reuse/simplification — no duplicated logic; the new code follows the exact shape of the sibling adapters (build_anthropic_search_body, zai::build_body) and reuses shared helpers (search_prompt, citation_from_url, push_citation, bounded_answer) rather than reimplementing them.

Tests — adequate: one unit test on the request-body shape (mimo_payload_forces_bounded_web_search_plugin), one on response parsing (mimo_parser_keeps_non_streaming_annotations), and one route-level capability test covering the documented model, a neighboring undocumented model, and a custom endpoint.

Docs/changelogdocs/PROVIDERS.md, CHANGELOG.md, and crates/tui/CHANGELOG.md are updated consistently and accurately describe the fail-closed scope.

Note on verification: I was not able to run cargo build/cargo test in this sandbox (cargo invocations require approval that isn't available in this non-interactive review context), so this review is based on careful static reading of the diff and cross-referencing the call sites, not a compiled/executed check. The code compiles logically (exhaustive matches, consistent types) but I'd recommend confirming CI is green before merge.

No blocking issues found. This looks safe to merge pending green CI.

@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: d39ed157be

ℹ️ 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 thread CHANGELOG.md

### Added

- Add provider-native web search for documented Xiaomi MiMo 2.5 Pro and 2.5

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Restore the human contributor’s commit credit

This rescued change is authored and committed solely by Codex <codex@openai.com>, has no Co-authored-by trailer for h3c-hexin, and the original human-authored commit cf8f4b74 is not in this commit’s ancestry. Mentioning the contributor only in the commit prose does not preserve durable Git authorship; retain the original commit or add the canonical identity from .github/AUTHOR_MAP.

AGENTS.md reference: AGENTS.md:L102-L106

Useful? React with 👍 / 👎.

@Hmbown
Hmbown merged commit c8f38f0 into main Aug 28, 2026
28 checks passed
@Hmbown
Hmbown deleted the codex/v0912-mimo-native-search-5687-20260828 branch August 28, 2026 17:57
pull Bot pushed a commit to Stars1233/DeepSeek-TUI that referenced this pull request Aug 30, 2026
… native search

Rescue merge of abb9978 (Pinvou feat/moonshot-kimi-provider-native-search,
PR Hmbown#5686) onto current main (142 ahead). Contributor head preserved verbatim
as the second parent; conflicts resolved following the landed native-search
adapter pattern (Hmbown#5682/Hmbown#5683/Hmbown#5690/Hmbown#5691/Hmbown#5693): main's Mimo/Zai/ModelStudio/
DeepSeek adapters and the post-fallback domain-constraint/budget plumbing
stay, the Kimi module + Moonshot dispatch and capability wiring join them.

Signed-off-by: CodeWhale Bot <bot@codewhale.net>
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.

2 participants