ApplicationIntegrationToolset silently builds no tools when a Connectors schema operation fails, and waits forever on one that never finishes
Maintainer thường phản hồi trong vòng 6 ngày
@sanketpatil06 đang làm issue này rồi.
Từ ngày 18/9/2026.
Đánh giá
Issue này chưa được đánh giá.
Mô tả
🔴 Required Information
Describe the Bug:
ConnectionsClient._poll_operation() (used by ApplicationIntegrationToolset for connection entities and actions) has two problems:
- A failed operation is treated as success. A finished Connectors long-running operation carries either
responseorerror(google.longrunning.Operation). The loop only checksdone, and the callers then readresponse.jsonSchema/response.operations, falling back to{}/[]. So when the lookup fails, for example because of a mistyped entity or action name or a missing permission on the connection, the toolset builds without error and with no tools for that entity. With explicit operations it builds tools against an empty schema, and a failed action produces a tool with an empty display name. Nothing tells the developer why the agent can't reach the connector. - The wait is unbounded.
while not operation_done:has no deadline, so an operation that never finishes blocks toolset construction, and therefore agent startup, forever. bf4143ac bounded each HTTP call in this client for exactly this reason ("an unavailable endpoint could block agent execution indefinitely"), but the polling loop around those calls is still open-ended.
It also sleeps one extra second after the operation is already done, which slows every entity and action lookup.
Steps to Reproduce:
pip install google-adk(reproduced onmain@ f33d4923 / 2.9.0).- Run the script below. It builds a real
ApplicationIntegrationToolsetfor a connection whosegetEntityTypeoperation finishes witherror(entityAcountdoes not exist). HTTP is stubbed, so no GCP project is needed.
Expected Behavior:
Toolset construction fails with the operation's error message, and a stuck operation fails after a bounded wait.
Observed Behavior:
toolset built; tools: []
elapsed: 1.0s
Environment Details:
- ADK Library Version (pip show google-adk): 2.9.0 (
main@ f33d4923) - Desktop OS: Windows 11
- Python Version (python -V): 3.12.10
Model Information:
- Are you using LiteLLM: No
- Which model is being used: N/A (toolset construction, no model call)
🟡 Optional Information
Minimal Reproduction Code:
import asyncio
from unittest import mock
from google.adk.tools.application_integration_tool import ApplicationIntegrationToolset
from google.adk.tools.application_integration_tool.clients.connections_client import ConnectionsClient
FAILED_OP = {
"name": "operations/op-1",
"done": True,
"error": {"code": 5, "message": "Entity type 'Acount' not found."},
}
def fake_get(url, headers=None, timeout=None):
resp = mock.MagicMock(status_code=200)
if url.endswith("?view=BASIC"):
resp.json.return_value = {"name": "projects/p/locations/us-central1/connections/sfdc",
"serviceDirectory": "sd", "host": ""}
elif "getEntityType" in url:
resp.json.return_value = {"name": "operations/op-1"}
else:
resp.json.return_value = FAILED_OP
return resp
mod = "google.adk.tools.application_integration_tool.clients.connections_client"
with mock.patch(f"{mod}._mtls_utils.get_api_endpoint", return_value="connectors.googleapis.com"), \
mock.patch.object(ConnectionsClient, "_get_access_token", return_value="token"), \
mock.patch(f"{mod}.requests.get", side_effect=fake_get):
toolset = ApplicationIntegrationToolset(
project="p", location="us-central1", connection="sfdc",
entity_operations={"Acount": []}, # typo for "Account"
)
print("toolset built; tools:", [t.name for t in asyncio.run(toolset.get_tools())])
Suggested fix: in _poll_operation, raise ValueError with the operation's error message when a finished operation carries error. That's the error type the callers already document. Stop polling after a deadline with TimeoutError, and don't sleep once done is set. I have a PR ready with tests.
How often has this issue occurred?:
- Always (100%): any failed entity or action schema lookup.
- Ngôn ngữ chính
- Python
- Star
- 21.6k
- Fork
- 4k
- Merge trung bình
- 9 giờ 59 phút
- Pull request đã merge (30 ngày)
- 5
Chuẩn bị môi trường
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của google/adk-python
-
A2aAgentExecutor sends the raw exception text to the A2A caller when the run failsCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
google/adk-python#7385 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 6 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
google/adk-python#7381 ·
Maintainer thường phản hồi trong vòng 6 ngày
-
[A2A] RemoteA2aAgent(use_legacy=False): extension header written to state['http_kwargs'], ignored by a2a-sdk 1.x transportsCó thể đã có người làm @surajksharma07 đã nhận 5 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
google/adk-python#7334 · 2 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 6 ngày
-
RestApiTool raises uncaught KeyError when a required path param is omittedCó thể đã có người làm @llalitkumarrr đã nhận 6 ngày trước. Đang mởrequest clarification tools
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
google/adk-python#7282 · 5 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 6 ngày
-
CredentialsManager should also extract scopes when populating auth schemesCó thể đã có người làm @sanketpatil06 đã nhận 9 ngày trước. Đang mởcore needs review
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
google/adk-python#7266 · 2 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 6 ngày
Tất cả issue của google/adk-python
Issue tương tự
-
enhancement P2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Toloka/tolokaforge#1776 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
TencentCloud/Octop#1622 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Independent PhaseMap objects share and leak their default mode groupingCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 68/100
-
Rust: `const _` gets its file's node ID, so the file node is relabelled `_` and gains a self-loopĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Graphify-Labs/graphify#4064 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày