Skip to content

Runner reports "App name mismatch detected" warning when using google.adk.Agent base class directly #4672

@yinggangtian

Description

@yinggangtian

Describe the Bug:
Runner reports App name mismatch detected warning when app_name is set to SFC_agent, but the root agent uses the official base class google.adk.Agent (defined in google/adk/agents), which is inferred as agents, causing a WARNING on every startup.

Steps to Reproduce:

  1. Install google-adk==1.20.0 in Docker slim environment with Python 3.12
  2. Create a root agent using google.adk.Agent base class directly
  3. Run adk api_server --host 0.0.0.0 --port 8080 with app_name set to SFC_agent (or default from working directory)
  4. Send any request to the API
  5. Observe WARNING in logs: WARNING - App name mismatch detected. The runner is configured with app name "SFC_agent", but the root agent was loaded from ".../site-packages/google/adk/agents", which implies app name "agents".

Expected Behavior:

  • Explicitly set app_name should override the inferred result without generating a warning; or
  • Provide an option to disable/ignore this check; or
  • Document that using the built-in base class directly will trigger this check and provide recommended practices

Observed Behavior:
Every startup generates WARNING:

WARNING - App name mismatch detected. The runner is configured with app name "SFC_agent", but the root agent was loaded from ".../site-packages/google/adk/agents", which implies app name "agents".

Environment Details:

  • ADK Library Version (pip show google-adk): 1.20.0
  • google cloud run
  • Python Version (python -V): 3.12

Model Information:

  • Are you using LiteLLM: No
  • Which model is being used: gemini-3-flash-preview

🟡 Optional Information

Regression:
N/A - First version used

Logs:

WARNING - App name mismatch detected. The runner is configured with app name "SFC_agent", but the root agent was loaded from ".../site-packages/google/adk/agents", which implies app name "agents".

Screenshots / Video:
N/A

Additional Context:
Workaround: Define a local subclass class RootAgent(Agent): pass in the project and use it, so the inferred path falls within the project package, which eliminates the warning.

Minimal Reproduction Code:

from google.adk import Agent

def get_current_time(city: str) -> dict:
    return {"status": "success", "city": city, "time": "10:30 AM"}

root_agent = Agent(
    model="gemini-3-flash-preview",
    name="root_agent",
    description="Tells the current time in a specified city.",
    instruction="Use get_current_time.",
    tools=[get_current_time],
)

How often has this issue occurred?:

  • Always (100%)

Metadata

Metadata

Labels

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

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions