Skip to content

fix: use Optional[List[str]] in cleanup_unused_files to fix automatic function calling parse error - #6517

Closed
guptaishaan wants to merge 1 commit into
google:mainfrom
guptaishaan:fix/issue-3591-2237
Closed

guptaishaan wants to merge 1 commit into
google:mainfrom
guptaishaan:fix/issue-3591-2237

Conversation

@guptaishaan

Copy link
Copy Markdown
Contributor

The cleanup_unused_files tool function declared its optional list parameters using
PEP 604 union syntax (list[str] | None), which the ADK automatic function calling
parameter parser does not support, causing a Failed to parse the parameter file_patterns: List[str] | None = None error whenever the agent builder assistant
was used in adk web.

The fix replaces the two affected parameter annotations with the equivalent
Optional[List[str]] form (from typing), which the parser handles correctly.
This matches the pattern already used in other built-in agent tools such as
search_adk_source.py.

Fixes #3591.

… function calling parse error

The `cleanup_unused_files` tool function declared its optional list parameters using

Signed-off-by: Ishaan <[email protected]>
@xuanyang15

Copy link
Copy Markdown
Collaborator

Thanks for creating this PR. The issue bas been resolved by cbedafd.

@xuanyang15 xuanyang15 closed this Aug 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tools [Component] This issue is related to tools

Projects

None yet

3 participants