add WebSearchTool with Metaso API integration - #133
Closed
mrluanma wants to merge 1 commit into
Closed
Conversation
Implement web_search tool using the Metaso search API. The tool supports query-based web search with configurable result count, API key resolution from METASO_API_KEY env var, and comprehensive error handling for rate limits, auth failures, and daily quotas. Metaso provides 100-free-searches/day quota. You can set your own `METASO_API_KEY` environment variable to raise that limit.
Collaborator
|
Closing this branch — it targets The WebSearchTool idea is worth having. Two things would need to change in a version against
Separately, and worth acting on regardless of this PR: that key has been visible in this diff since May. It should be rotated. |
pull Bot
pushed a commit
to ari1988/DeepCode
that referenced
this pull request
Aug 6, 2026
The Secret history scan has failed on main since dd8f0a8. Cause: merging HKUDS#131 with -s ours recorded the branch in history without applying its tree, and gitleaks scans history, not the working tree. The finding is a fixture, not a credential — the literal "sk-secret123456" inside a RuntimeError message, asserting that error text is redacted before it reaches the UI. Its file, tests/ui_session_resume_test.py, does not exist on main, so the finding cannot be fixed by editing it; a fingerprint entry is the only route. Verified: gitleaks over origin/main now reports no leaks across 240 commits. Note for future -s ours merges: they bring the branch's full history under the secret scan. Two branches deliberately left unmerged (HKUDS#133, HKUDS#143) carry findings of their own, and HKUDS#133's is a real key — merging them for attribution alone would have put it in main's history permanently. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds
WebSearchTool— a web search tool backed by the Metaso API — and registers it in the default agent toolset. Includes a built-in default API key with ~100 free searches/day.Related Issues
None.
Changes Made
nanobot/agent/tools/web.py— Added_get_metaso_api_key()helper (falls back to built-in default key), andWebSearchToolclass withweb_searchname, supportingqueryand optionaltopKparams.nanobot/agent/loop.py— Imported and registeredWebSearchToolalongsideWebFetchTool.nanobot/workspace/TOOLS.md— Documented the newweb_searchtool.tests/web_search_test.py— 387 lines of tests covering API key resolution, search responses, error handling, and edge cases.