🔴 Required Information
Describe the Bug:
Importing the public LlmAgent class emits a BaseAgentConfig deprecation warning even when the application never imports or uses the deprecated YAML Agent Config feature. Test suites that treat deprecations as errors therefore fail during an ordinary ADK import.
Steps to Reproduce:
- Create a clean Python 3.12 environment.
- Install the current release.
- Import the supported runtime agent classes with deprecations treated as errors:
python3.12 -m venv .venv
.venv/bin/pip install 'google-adk==2.8.0'
.venv/bin/python -W error::DeprecationWarning \
-c 'from google.adk.agents import LlmAgent, SequentialAgent'
Expected Behavior:
Importing supported programmatic runtime agent classes should not emit a warning about deprecated Agent Config APIs that the application did not use.
Observed Behavior:
The import exits 1 while ADK defines its own internal config subclass:
google/adk/agents/llm_agent.py:71
from .llm_agent_config import LlmAgentConfig as LlmAgentConfig
google/adk/agents/llm_agent_config.py:37
class LlmAgentConfig(BaseAgentConfig):
typing_extensions.py:3125
warnings.warn(msg, category=category, stacklevel=stacklevel + 1)
DeprecationWarning: BaseAgentConfig is deprecated and will be removed in future versions.
Config is now loaded via reflection so the separate config class is no longer needed.
Environment Details:
- ADK Library Version: reproduced with
google-adk==2.7.1 and latest PyPI google-adk==2.8.0
- Current main: also reproduced at
40c8333460c6337fdf05f1e33964110bd8567f5a
- Desktop OS: Linux
- Python Version:
3.12.12
Model Information:
- Are you using LiteLLM: No
- Which model is being used: N/A; the failure occurs during import before any model is configured
🟡 Optional Information
Regression:
Confirmed in 2.7.1, 2.8.0, and current unreleased main. I did not identify a released version where this import path was warning-free.
Logs:
The complete failure is the traceback above. The behavior occurs every time in a fresh interpreter.
Additional Context:
Best-supported root cause on tag v2.8.0 (76a96e6221f1e2758a1ff82fde199cd079e9c654):
base_agent_config.py:36-42 decorates BaseAgentConfig with typing_extensions.deprecated.
llm_agent_config.py:32-37 defines ADK's decorated LlmAgentConfig as a subclass of BaseAgentConfig.
llm_agent.py:71 imports that config during an ordinary LlmAgent import.
typing_extensions.deprecated warns while the deprecated base is subclassed, so the warning originates from ADK's own class declaration rather than downstream use of Agent Config.
This warning also appears in unrelated test output in #6367 and #5909, but neither artifact reports or fixes the import-time warning. The nearest sibling item is google/adk-docs#1833, which asks to document Agent Config deprecation; this issue is distinct because supported programmatic imports trigger the warning without using Agent Config.
Building Waterline surfaced this in a 54-test ADK backend suite. Waterline constructs LlmAgent and SequentialAgent programmatically and does not use YAML Agent Config.
A narrow regression test could run the import in a fresh subprocess with -W error::DeprecationWarning, so module caching cannot hide the warning. Any fix should preserve deprecation warnings for applications that actually use deprecated Agent Config APIs rather than suppressing deprecations broadly.
Minimal Reproduction Code:
from google.adk.agents import LlmAgent, SequentialAgent
Run with:
python -W error::DeprecationWarning reproduction.py
How often has this issue occurred?:
🔴 Required Information
Describe the Bug:
Importing the public
LlmAgentclass emits aBaseAgentConfigdeprecation warning even when the application never imports or uses the deprecated YAML Agent Config feature. Test suites that treat deprecations as errors therefore fail during an ordinary ADK import.Steps to Reproduce:
Expected Behavior:
Importing supported programmatic runtime agent classes should not emit a warning about deprecated Agent Config APIs that the application did not use.
Observed Behavior:
The import exits
1while ADK defines its own internal config subclass:Environment Details:
google-adk==2.7.1and latest PyPIgoogle-adk==2.8.040c8333460c6337fdf05f1e33964110bd8567f5a3.12.12Model Information:
🟡 Optional Information
Regression:
Confirmed in
2.7.1,2.8.0, and current unreleasedmain. I did not identify a released version where this import path was warning-free.Logs:
The complete failure is the traceback above. The behavior occurs every time in a fresh interpreter.
Additional Context:
Best-supported root cause on tag
v2.8.0(76a96e6221f1e2758a1ff82fde199cd079e9c654):base_agent_config.py:36-42decoratesBaseAgentConfigwithtyping_extensions.deprecated.llm_agent_config.py:32-37defines ADK's decoratedLlmAgentConfigas a subclass ofBaseAgentConfig.llm_agent.py:71imports that config during an ordinaryLlmAgentimport.typing_extensions.deprecatedwarns while the deprecated base is subclassed, so the warning originates from ADK's own class declaration rather than downstream use of Agent Config.This warning also appears in unrelated test output in #6367 and #5909, but neither artifact reports or fixes the import-time warning. The nearest sibling item is google/adk-docs#1833, which asks to document Agent Config deprecation; this issue is distinct because supported programmatic imports trigger the warning without using Agent Config.
Building Waterline surfaced this in a 54-test ADK backend suite. Waterline constructs
LlmAgentandSequentialAgentprogrammatically and does not use YAML Agent Config.A narrow regression test could run the import in a fresh subprocess with
-W error::DeprecationWarning, so module caching cannot hide the warning. Any fix should preserve deprecation warnings for applications that actually use deprecated Agent Config APIs rather than suppressing deprecations broadly.Minimal Reproduction Code:
Run with:
How often has this issue occurred?: