Commit cbedafd
fix: use typing.Optional in cleanup_unused_files to fix parse error
The `cleanup_unused_files` tool was declared with `list[str] | None` union-type annotations (PEP 604 / Python 3.10+ syntax). ADK's automatic function calling schema parser does not support this syntax, causing the error "Failed to parse the parameter file_patterns: List[str] | None = None" whenever the agent builder assistant was invoked.
The fix replaces the two affected parameters (`file_patterns` and `used_files`) with `Optional[List[str]]` and `List[str]` from the `typing` module, which is the style already used throughout the other tool files in the same package (e.g. `delete_files.py`). No behaviour change — only the type annotation form is updated.
Fixes #3591
Merge #6502
PiperOrigin-RevId: 9587378491 parent ad9c113 commit cbedafd
1 file changed
Lines changed: 5 additions & 3 deletions
Lines changed: 5 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
| 21 | + | |
20 | 22 | | |
21 | 23 | | |
22 | 24 | | |
| |||
25 | 27 | | |
26 | 28 | | |
27 | 29 | | |
28 | | - | |
| 30 | + | |
29 | 31 | | |
30 | | - | |
31 | | - | |
| 32 | + | |
| 33 | + | |
32 | 34 | | |
33 | 35 | | |
34 | 36 | | |
| |||
0 commit comments