feat(web): add Z.AI and BigModel native search (rescue of #5685) - #5691
Conversation
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 finished @Hmbown's task in 2m 59s —— View job Claude's review of PR #5691Todo list
SummaryThis is a clean, well-scoped rescue of #5685: it wires structured Z.AI/Zhipu web search behind an exact base-URL allowlist ( Correctness
Provider/model/route safety (EPIC #2608)
Reuse/simplification
Tests
Minor nit (non-blocking)
No blocking issues found. Nice work keeping the fail-closed boundary exact on both the adapter and route-resolver sides. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 198326110b
ℹ️ 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".
| let normalized = base_url.trim().trim_end_matches('/').to_ascii_lowercase(); | ||
| if !matches!( | ||
| normalized.as_str(), | ||
| "https://api.z.ai/api/paas/v4" | "https://open.bigmodel.cn/api/paas/v4" |
There was a problem hiding this comment.
Preserve path case when matching exact Z.AI routes
When a configured URL uses a differently cased path such as https://api.z.ai/API/paas/v4, this lowercasing marks the route as search-capable even though URL paths are case-sensitive. The adapter similarly accepts the normalized value, but api_url retains the original path and posts to /API/paas/v4/web_search, causing a failed request instead of failing closed during route resolution. This also conflicts with the existing exact-route predicate and test in provider.rs, which deliberately reject the uppercase-path form; normalize only the scheme/host while comparing the path exactly.
Useful? React with 👍 / 👎.
Summary
search-primeforapi.z.aiandsearch_stdforopen.bigmodel.cn; Coding Plan, neighboring paths, and custom-compatible endpoints remain fail-closed.open.bigmodel.cn/api/paas/v4configuration as part of Z.AI's official endpoint family so model aliases and credential scope use the existing Z.AI identity.Reconciliation notes: the adapter's provider gate now admits Openai, Anthropic, Xai, Zai, ModelStudio Token Plan, DeepSeek, and DeepSeek-CN together; route capability arms and tests from all three sibling slices coexist; both changelog entries retained and regenerated in sync.
No-Issue: partial delivery tracked by #5681; this slice must not close the umbrella issue.
Supersedes #5685 (which stays credited to h3c-hexin).