Add swappable websearch backend, make Tako search default - #1600
Open
jed326 wants to merge 1 commit into
Open
Conversation
jed326
marked this pull request as ready for review
September 4, 2026 18:04
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.
Supersedes #1175
Addresses #228 (review)
As requested in the review comment above, this PR introduces a generic, swappable backend to the websearch tool and uses Tako Search as the default backend.
All existing functionality is preserved and keyless search still works through Tako MCP. The Tako backend uses the async lane of
tako-sdkfor its request and response models.Testing
run-tool-tests.shruns them;validate_cli_packaging.pyanduv build --wheelpass. The unit tests cover the stream paths a live run can't force: a dropped stream resuming withstarting_after, a non-SSE body on resume, anagent_resultframe the SDK can't parse, and a stream that ends without a result, each falling through to polling the run; plus the 401 and 403 fallback from keyed to anonymous search.tako:api, plain,--effort deep, and--include-domainwith--max-age-hours), keyed deep-research (tako:agent, 99s, $0.15), and the fallback for a bad Tako key. Parallel keyed and anonymous, the bad Anthropic key, and a blank or bogusWEBSEARCH_BACKENDwere exercised before the Tako backend moved onto the SDK; that code did not change.jed326/centaur@websearch-tako-backendastoolServer.ref(its tool tree is identical to this PR's): the shim reinstalled with the SDK dependency,websearch --helpworks, an ungranted principal getstako:anonymous, and the principal withcentaur-perms principals grant --tool websearchgetstako:apiplus a deep-research report (tako:agent). The SDK's httpx client trusted the sandbox proxy's CA and the proxy rewroteX-API-Key. Sandbox pods never holdTAKO_API_KEY; only the per-sandbox proxy does.