Skip to content

fix(agents): add missing BaseLlm import to prevent NameError in sub-agents#5443

Open
EaCognitive wants to merge 3 commits intogoogle:mainfrom
EaCognitive:fix-nameerror-basellm
Open

fix(agents): add missing BaseLlm import to prevent NameError in sub-agents#5443
EaCognitive wants to merge 3 commits intogoogle:mainfrom
EaCognitive:fix-nameerror-basellm

Conversation

@EaCognitive
Copy link
Copy Markdown

Fixes #2082

Problem

In LlmAgent.canonical_model, there is a check isinstance(self.model, BaseLlm). However, BaseLlm is not imported in the module, leading to a NameError at runtime when an agent attempts to resolve its model. This is particularly critical in sub-agent scenarios where model inheritance is common.

Solution

Added the missing BaseLlm import from ..models.base_llm.

Verification

Verified that the import is present and resolves correctly.

@adk-bot adk-bot added the core [Component] This issue is related to the core interface and implementation label Apr 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core [Component] This issue is related to the core interface and implementation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🚨 CRITICAL: ADK Framework Bug - NameError: name in LlmAgent Sub-Agent Execution

2 participants