-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Labels
tools[Component] This issue is related to tools[Component] This issue is related to tools
Description
Bug Description
PR #2872 switched OpenAPI tools from requests (sync) to httpx.AsyncClient (async) in rest_api_tool.py. However, the new _request function does not specify a timeout parameter:
async def _request(**request_params) -> httpx.Response:
async with httpx.AsyncClient(
verify=request_params.pop("verify", True)
) as client:
return await client.request(**request_params)requestshas no default timeout (waits indefinitely)httpx.AsyncClienthas a default timeout of 5 seconds
This means API calls that previously worked fine now fail with httpx.ReadTimeout if they take longer than 5 seconds.
Steps to Reproduce
- Configure an OpenAPI tool that calls a slower external API
- Upgrade from google-adk 1.23.0 to 1.24.0
- Execute a tool call that takes more than 5 seconds
Expected Behavior
The API call should succeed as it did in 1.23.0 with requests.
Actual Behavior
httpx.ReadTimeout is raised after 5 seconds.
Suggested Fix
Add an explicit timeout to httpx.AsyncClient in _request. The appropriate value is up to the ADK team, but the current implicit 5s default is too short for many real-world API calls.
Environment
- google-adk: 1.24.0+
- Python: 3.13
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
tools[Component] This issue is related to tools[Component] This issue is related to tools