Repository navigation
[BUG]: importing LlmAgent emits BaseAgentConfig deprecation warning from ADK internals #6968
Description
🔴 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.1and latest PyPIgoogle-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-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 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, SequentialAgentRun with:
python -W error::DeprecationWarning reproduction.pyHow often has this issue occurred?:
- Always (100%)
Activity
chelsealong commentedon Aug 31, 2026
Picking this one up now — opening a PR shortly. Flagging it here so nobody duplicates the work; if someone is already on it, say so and I will drop mine.
surajksharma07 commentedon Sep 1, 2026
@Zen-cronic It's coming from LlmAgentConfig/SequentialAgentConfig subclassing the deprecated BaseAgentConfig at import time. A fix is already in review (#6970) but until that lands try adding warnings.filterwarnings("ignore", message="BaseAgentConfig is deprecated", category=DeprecationWarning) before your import as a stopgap.
Can you verify that unblocks your CI? Once you confirm it works we'll prioritize getting #6970 reviewed and merged rather than needing a separate PR from you.
fix: stop internal Agent Config subclassing from warning on plain imp…