From 4fb0843fdf0f75d4f3633d7c4d14953d90ff0727 Mon Sep 17 00:00:00 2001 From: Ishaan Date: Thu, 30 Jul 2026 09:03:57 +0000 Subject: [PATCH] fix: use Optional[List[str]] in cleanup_unused_files to fix automatic function calling parse error The `cleanup_unused_files` tool function declared its optional list parameters using Signed-off-by: Ishaan --- .../adk/cli/built_in_agents/tools/cleanup_unused_files.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/google/adk/cli/built_in_agents/tools/cleanup_unused_files.py b/src/google/adk/cli/built_in_agents/tools/cleanup_unused_files.py index 6b144e8fde6..9eb478c4b95 100644 --- a/src/google/adk/cli/built_in_agents/tools/cleanup_unused_files.py +++ b/src/google/adk/cli/built_in_agents/tools/cleanup_unused_files.py @@ -17,6 +17,8 @@ from __future__ import annotations from typing import Any +from typing import List +from typing import Optional from google.adk.tools.tool_context import ToolContext @@ -27,8 +29,8 @@ async def cleanup_unused_files( used_files: list[str], tool_context: ToolContext, - file_patterns: list[str] | None = None, - exclude_patterns: list[str] | None = None, + file_patterns: Optional[List[str]] = None, + exclude_patterns: Optional[List[str]] = None, ) -> dict[str, Any]: """Identify and optionally delete unused files in project directories.