Skip to content

feat(tools): add web_search and web_fetch tools - #78

Merged
devproje merged 1 commit into
masterfrom
feat/web-search-fetch-tools
Sep 23, 2026
Merged

devproje merged 1 commit into
masterfrom
feat/web-search-fetch-tools

Conversation

@devproje

Copy link
Copy Markdown
Owner

What this changes

compute_use (modules/browser) already covers browser automation + screenshot capture. This adds two more read-only tools: web_search (Brave, Tavily, or Ollama Search — whichever backend is selected) and web_fetch (a direct, SSRF-guarded GET, or Tavily's extract endpoint when Tavily is the selected backend).

Backend configuration is a new web_providers table managed via mininaru webprovider add/list/show/set/primary/remove. It follows the single-selection shape agents.selected uses (one row selected at a time via a unique partial index), not the active-column shape providers once had and later dropped in 0007_agent_selected_provider_active_removal.sql — reusing the pattern the project kept, not the one it abandoned. api_key is encrypted at rest the same way providers.api_key already is.

modules/web_search/modules/web_fetch take a WebBackendLookup closure from core/tools.go rather than importing core directly, since core already imports them and a direct import would cycle.

Also renames a batch of pre-existing multi-word filenames to snake_case for consistency with the new files (core/agentspawn.go → agent_spawn.go, util/apikey.go → api_key.go, and others), and fixes the stale filenames docs/ARCHITECTURE.md referenced.

How it was verified

  • make test-race passes
  • New behaviour has a test, or there is nothing to test

Added core/web_provider_test.go (CRUD + auto-select-first + WebProviderSelect/WebProviderSelected, mirroring core/agent_test.go's style), modules/web_fetch/web_fetch_test.go (the bogon/SSRF guard actually rejects loopback/private/link-local addresses, including against a real httptest.Server on 127.0.0.1), and modules/web_search/web_search_test.go (arg validation, backend dispatch, result formatting).

Checklist

  • Follows docs/CONVENTION.md: no comments, no :=, one var block per function in first-use order with err last, callees before callers, and main unconditionally last
  • New .go files carry the two-line SPDX header
  • Documentation updated if behaviour a user can see has changed (docs/ARCHITECTURE.md)
  • My contribution is licensed GPL-3.0-only, matching the project

compute_use (modules/browser) already covered browser automation and
capture; there was no way to search the web or fetch a single URL
without a browser session. Add web_search (Brave, Tavily, or Ollama
Search, whichever backend is selected) and web_fetch (a direct,
SSRF-guarded GET, or Tavily's extract endpoint when Tavily is
selected).

Backend configuration lives in a new web_providers table, managed by
`mininaru webprovider`. It follows agents.selected's single-selection
shape (one row selected at a time via a unique partial index) rather
than the active-column shape providers once had and later dropped, and
reuses the existing at-rest encryption for api_key. modules/web_search
and modules/web_fetch take a WebBackendLookup closure from core/tools.go
instead of importing core directly, since core already imports them
and a direct import would cycle.

Also rename a batch of existing multi-word filenames to snake_case
(core/agentspawn.go -> agent_spawn.go, util/apikey.go -> api_key.go,
and others) for consistency with the new files, and fix the stale
filenames that referenced in docs/ARCHITECTURE.md.
@devproje
devproje merged commit 086f4d4 into master Sep 23, 2026
3 checks passed
@devproje
devproje deleted the feat/web-search-fetch-tools branch September 23, 2026 01:40
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.

1 participant