feat(tools): add AgentCore Web Search as a Strands Agents tool - #672
sundargthb wants to merge 1 commit into
Conversation
|
Claude Security Review: no high-confidence findings. (run) |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #672 +/- ##
=======================================
Coverage ? 89.60%
=======================================
Files ? 125
Lines ? 10783
Branches ? 1692
=======================================
Hits ? 9662
Misses ? 733
Partials ? 388
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Exposes the web search tool as a single Strands tool, alongside the existing memory, payments and gateway Strands integrations, behind the same strands-agents extra. Attributed with integration_source="strands". Which transport is used stays inside WebSearchClient. Every gateway argument here is optional and only the ones supplied are forwarded, so the direct web search API will work through the same call without a signature change. Two behaviours the tests pin down: - region is defaulted only when no region and no gateway ARN were given. The client prefers an explicit region over the ARN's, so defaulting it unconditionally sends a eu-west-1 gateway's traffic to us-east-1. - a failed search raises rather than returning the message as a result. The Strands executor turns that into a status=error tool result, which a model can react to; a successful result reading "search failed" is indistinguishable to it from a search that found nothing. Unit tests cover the module to 100% branch coverage. The integration tests need a gateway with a web search target and have not been run.
4457ff7 to
c42eb68
Compare
|
Claude Security Review: no high-confidence findings. (run) |
|
Superseded by #673, same commit pushed as a branch on this repo so the integration test jobs can actually run. The fork variant could not run them: |
Description
Adds
AgentCoreWebSearch, exposing the AgentCore Web Search tool as a Strands Agents tool. Placement followsmemory/integrations/strands,payments/integrations/strandsandgateway/integrations/strands: a subpackage behind the existingstrands-agentsextra, reached only by explicit import. Nopyproject.tomlchange, and a base install is unaffected.Draft for one reason: the tests in
tests_integ/have not been run. I don't currently have credentials for an account entitled to the web search connector, so I'm not claiming this is verified against a live gateway. Marking ready once they've run.Two behaviours worth a look in review
regionis defaulted only when no region and no gateway ARN were given.WebSearchClientdoesregion = region or arn_region, so filling a default in here unconditionally would silently send aeu-west-1gateway's traffic tous-east-1.A failed search raises rather than returning the message as a result. The Strands executor converts the exception to a
status: "error"tool result, so the agent keeps running and the model can react. Returning"Web search failed: ..."as a successful result is indistinguishable to the model from a search that found nothing.I checked both by mutating the source and confirming exactly one test failed each time, rather than only that the suite passes.
One forward-compatibility note: which transport is used stays inside
WebSearchClient. Every gateway argument here is optional and only the ones supplied are forwarded, so the direct web search API will work through the same call without a signature change in this module.Testing
tests_integ/tools/integrations/strands/test_web_search_integration.pyis not in that run. It needsWEB_SEARCH_GATEWAY_IDpointing at a gateway with a web search target, on an account entitled to the connector.Related
WebSearchClientthis wraps, and itstests_integ/tools/test_web_search_client.py