Skip to content

ApplicationIntegrationToolset breaks in v1.24.0 #4555

@HonzaKopecky

Description

@HonzaKopecky

🔴 Required Information

Describe the Bug:

Since v1.24.0 ApplicationIntegrationToolset functionality no longer works. All requests made to the Integrations API result in HTTP 400 error.

Steps to Reproduce:

  1. Follow AIT guide from the docs (https://google.github.io/adk-docs/integrations/application-integration/) to implement a simple agent using AIT.
  2. Run the agent locally via adk web.

Expected Behavior:

AIT should communicate with Integrations API.

Observed Behavior:

All requests to Integrations API result in an HTTP 400 error because of malformed API URL.

Environment Details:

  • ADK Library Version: 1.24.0 onwards
  • Desktop OS: Linux
  • Python Version: 3.13.3

Model Information:

  • Are you using LiteLLM: No
  • Which model is being used: gemini-2.5-flash

🟡 Optional Information

Regression:

Yes, I tested version by version and this bug wasn't present until v1.24.0.

Minimal Reproduction Code:

agent.py

from google.adk.agents import LlmAgent
from google.adk.auth import AuthCredential
from google.adk.auth import AuthCredentialTypes
from google.adk.auth import OAuth2Auth
from google.adk.tools.application_integration_tool import ApplicationIntegrationToolset
from google.adk.tools.openapi_tool.auth.auth_helpers import dict_to_auth_scheme


oauth2_data_google_cloud = {
    "type": "oauth2",
    "flows": {
        "authorizationCode": {
            "authorizationUrl": "https://accounts.google.com/o/oauth2/auth",
            "tokenUrl": "https://oauth2.googleapis.com/token",
            "scopes": {
                "https://www.googleapis.com/auth/drive": "write",
            },
        }
    },
}

google_oauth_scheme = dict_to_auth_scheme(oauth2_data_google_cloud)

user_auth_credential = AuthCredential(
    auth_type=AuthCredentialTypes.OAUTH2,
    oauth2=OAuth2Auth(
        client_id="...",
        client_secret="...",
    ),
)

gdrive_toolset = ApplicationIntegrationToolset(
    project="...",
    location="...",
    connection="...",
    actions=["POST_files", "POST_files/%7BfileId%7D/copy"],
    tool_instructions="Use this tool to create or copy files in Google Drive.",
    auth_scheme=google_oauth_scheme,
    auth_credential=user_auth_credential,
)

agent_gdrive = LlmAgent(
    model="gemini-2.5-flash",
    name="agent_gdrive",
    instruction="""You are an intelligent assistant that can work with Google Drive files.
    You have two main capabilities:

    1. Create a new file.
       - Use the `drive_files_create` tool.
       - Your input is the new file's name and mimeType.
       - CORRECT tool call example:
         print(default_api.drive_files_create(connector_input_payload={{
           'RequestBody': {{
             'name': 'New Document Name',
             'mimeType': 'application/vnd.google-apps.document'
           }}
         }}))

    2. Copy an existing file.
       - Use the `drive_files_copy` tool.
       - Your input is the ID of the file to copy (`fileId`) and the name for the new copied file.
       - CORRECT tool call example:
         print(default_api.drive_files_copy(connector_input_payload={{
           'Path parameters': {{
             'fileId': '1a2B3cD4eF5GhI6J7K8L9M0N'
           }},
           'RequestBody': {{
             'name': 'New Copied Document Name'
           }}
         }}))

    CRITICAL: For all tools, the key for path parameters is the literal string "Path parameters", with a space. DO NOT use "Path_parameters".
    
    Do not use the `create_file` tool as it is broken.
    If you were delegated by another agent to perform an action, make sure to transfer the user back to the original agent after completing your task.
    """,
    description="Agent that can create or copy files in Google Drive.",
    output_key="agent_gdrive_output_key",
    tools=[gdrive_toolset],
)

root_agent = agent_gdrive

How often has this issue occurred?

  • Always (100%)

Additional Context

My investigation shows that the 400 erorr is caused by the fact that the requests are sent to an incorrect URL. From the logs one can confirm this problem as the requests are sent to e.g. https://integrations.googleapis.com/v2/projects/.../locations/us-central1/integrations/ExecuteConnection:execute#POST_files/%7BfileId%7D/copy URL. In the URL the ?triggerId=api_trigger/ExecuteConnection part is missing. While I researched further, I concluded that the most likely culprit is the fastapi update that comes with v1.24.0 since I can confirm that the integration_client.py implementation is constructing the URL correctly but the actual URL called later on is different. Seems like fastapi scrapes away the query parameter hardcoded in the path.

Logs

2026-02-19 17:48:19,387 - INFO - integration_connector_tool.py:188 - Running tool: drive_files_copy with args: {'connector_input_payload': {'RequestBody': {'name': 'Document Templater - ADK 1.24, no workaround'}, 'Path parameters': {'fileId': '...'}}, 'dynamic_auth_config': {'oauth2_auth_code_flow.access_token': '...'}, 'connection_name': 'projects/.../locations/us-central1/connections/con-gdrive-adk', 'service_name': 'projects/.../locations/us-central1/namespaces/cloudrun/services/runtime-tls', 'host': 'https://...-tp-us-central1.us-central1-runtime-connectors-google.com', 'entity': None, 'operation': 'EXECUTE_ACTION', 'action': 'POST_files/%7BfileId%7D/copy'}
2026-02-19 17:48:20,904 - INFO - _client.py:1740 - HTTP Request: POST https://integrations.googleapis.com/v2/projects/.../locations/us-central1/integrations/ExecuteConnection:execute#POST_files/%7BfileId%7D/copy "HTTP/1.1 400 Bad Request"
2026-02-19 17:48:20,906 - WARNING - rest_api_tool.py:528 - API call failed for tool drive_files_copy: Status 400 - {
  "error": {
    "code": 400,
    "message": "Request contains an invalid argument.",
    "status": "INVALID_ARGUMENT"
  }
}

Metadata

Metadata

Assignees

Labels

tools[Component] This issue is related to tools

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions