Skip to content

feat(web): add Metaso as a web search provider (metaso.cn)#1766

Closed
mrluanma wants to merge 2 commits into
Hmbown:mainfrom
meta-sota:feat/web-search-metaso
Closed

feat(web): add Metaso as a web search provider (metaso.cn)#1766
mrluanma wants to merge 2 commits into
Hmbown:mainfrom
meta-sota:feat/web-search-metaso

Conversation

@mrluanma
Copy link
Copy Markdown

@mrluanma mrluanma commented May 18, 2026

Summary

Adds Metaso AI Search as a new SearchProvider option alongside Bing, DuckDuckGo, Tavily, and Bocha.

Testing

  • cargo test --all-features
  • cargo fmt --all -- --check
  • cargo clippy --all-targets --all-features

Checklist

  • Updated docs or comments as needed
  • Added or updated tests where relevant
  • Verified TUI behavior manually if UI changes

Adds Metaso AI Search as a new SearchProvider option alongside Bing,
DuckDuckGo, Tavily, and Bocha.
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request adds Metaso as a new web search provider, including the necessary implementation in the web search tool, configuration updates, and documentation. The reviewer identified a security risk regarding the hardcoded default API key and suggested that the new unit test should mock network responses to ensure isolation from external services.

Comment thread crates/tui/src/tools/web_search.rs
Comment on lines +1340 to +1342
let result = WebSearchTool
.execute(json!({"query": "anything"}), &ctx)
.await;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

This test case triggers a real network request to metaso.cn because the Metaso provider uses a built-in default API key. Unit tests should be isolated from external services to ensure they are fast and reliable, especially in CI environments without internet access. Consider mocking the HTTP response or refactoring the code to test the API key resolution logic without making an actual network call.

@LIYUE1918
Copy link
Copy Markdown

Your api key was exposed.....

@mrluanma
Copy link
Copy Markdown
Author

Your api key was exposed.....

The bundled default API key has the 100/day quota per IP, it's intended to hardcode it in the code.

Adds an AGENTS.md entry and inline source comment explaining that
the hardcoded Metaso key is publicly provided for open-source use,
rate-limited to 100 searches/day, and is the last-resort fallback.
@Hmbown
Copy link
Copy Markdown
Owner

Hmbown commented May 23, 2026

This PR was opened before the v0.8.41 rebrand and is now stale. Feel free to rebase onto current main and reopen. 鲸鱼兄弟们等你 🐋

@Hmbown Hmbown closed this May 23, 2026
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.

3 participants