You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
BaseTool.from_config drops T | None arguments on Python 3.11-3.13Β #7840
Describe the Bug:
On Python 3.11β3.13, BaseTool.from_config drops every constructor argument annotated with PEP 604 syntax (T | None). Before Python 3.14, get_origin(int | None) is types.UnionType, not typing.Union. The Optional[T] unwrapping (if get_origin(param_type) is Union) is therefore skipped, no branch matches, and the value is discarded with only an "Unsupported parsing for argument" warning.
Several built-in tools rely on the default from_config and annotate their arguments this way, so YAML agent configs silently lose them. Among them:
agent = config_agent_utils.from_config("root_agent.yaml") and inspect agent.tools[0].vertex_rag_store.
Expected Behavior: rag_corpora, similarity_top_k and vector_distance_threshold are set from the config.
Observed Behavior:
Unsupported parsing for argument: rag_corpora.
Unsupported parsing for argument: similarity_top_k.
Unsupported parsing for argument: vector_distance_threshold.
rag_corpora: None
similarity_top_k: None
vector_distance_threshold: None
Environment Details:
ADK Library Version (pip show google-adk): 2.13.0 (also on main at 75fb788)
Desktop OS: macOS
Python Version (python -V): 3.11.16
Model Information:
Are you using LiteLLM: No
Which model is being used: N/A (config loading)
π‘ Optional Information
Additional Context: Optional[T] annotations work, which is why only some arguments are affected. #4371 / #4406 covered PEP 604 unions in function-declaration parsing, not this config path.
Hi @adityasingh2400 , thanks for reporting this and sending the fix.
We investigated this issue and were able to reproduce the behavior on our end. Your PR #7841 is currently under review by our team and it will be merged once approved. Thank you for your patience and understanding.
Activity
sanketpatil06 commentedon Nov 2, 2026
Hi @adityasingh2400 , thanks for reporting this and sending the fix.
We investigated this issue and were able to reproduce the behavior on our end. Your PR #7841 is currently under review by our team and it will be merged once approved. Thank you for your patience and understanding.
fix: unwrap PEP 604 optional parameters in BaseTool.from_config