Skip to content

Eval uses root agent directly rather than through registered app, skipping retry plugin #3833

Closed

Description

@klys-equinix

I have a root agent that I run via App so that I can handle its tool errors using ReflectAndRetryToolPlugin.
If I try to run evals for that agent, the evals use the root_agent directly, rather than via App

To Reproduce
Create a simple setup of an agent with a failing tool and an app using it, then create some evalset for it. The exception will not be handled

# Create the orchestrator agent with the AgentTools
root_agent = Agent(
    name="SomeAgent",
    model=ORCHESTRATOR_LLM_MODEL,
    instruction=prompt,
    tools=[
        some_failing_tool
    ],
)

app = App(
    root_agent=root_agent,
    name="app",
    plugins=[
      ReflectAndRetryToolPlugin(
            max_retries=3,
            throw_exception_if_retry_exceeded=False,  # Return message instead of raising
        ),
    ],
)

Expected behavior
I expect the evals to use the app rather then the agent if available

Desktop (please complete the following information):

  • OS: macOs
  • Python version(python -V): 3.13
  • ADK version(pip show google-adk): 1.22

Model Information:

  • Are you using LiteLLM: Yes/No: No
  • Which model is being used(e.g. gemini-2.5-pro): gemini-2.5-pro

Additional context
Take a look at

try:
eval_service = LocalEvalService(
root_agent=root_agent,
eval_sets_manager=eval_sets_manager,
eval_set_results_manager=eval_set_results_manager,
user_simulator_provider=user_simulator_provider,
)
inference_results = asyncio.run(
_collect_inferences(
inference_requests=inference_requests, eval_service=eval_service
)
)
eval_results = asyncio.run(
_collect_eval_results(
inference_results=inference_results,
eval_service=eval_service,
eval_metrics=eval_metrics,
)
)
except ModuleNotFoundError as mnf:
raise click.ClickException(MISSING_EVAL_DEPENDENCIES_MESSAGE) from mnf

It seems to me that LocalEvalService is using the root_agent directly

Activity

  1. added
    eval
    on Dec 5, 2025
  2. added theissue type on Dec 5, 2025
  3. added 3 commits that reference this issue on Dec 5, 2025
    bddcc5e
    a76304a
    ede184e
  4. self-assigned this
    on Dec 5, 2025
  5. adk-bot commented on Dec 18, 2025

    @adk-bot
    Collaborator

    Notification: The author has updated the issue description. Maintainers, please review.

  6. adk-bot commented on Dec 26, 2025

    @adk-bot
    Collaborator

    This issue has been automatically marked as stale because it has not had recent activity for 7 days after a maintainer requested clarification. It will be closed if no further activity occurs within 7 days.

  7. added
    stale
    request clarification
    on Dec 26, 2025
  8. removed
    request clarification
    stale
    on Dec 29, 2025
  9. added
    needs review
    on Feb 5, 2026
  10. surajksharma07 commented on May 13, 2026

    @surajksharma07
    Collaborator

    @klys-equinix the eval path calls EvaluationGenerator._generate_inferences_from_root_agent, which constructs Runner(agent=root_agent, ...) and completely bypasses the App, so any plugins registered there never fire.

    Worth trying as a workaround: drive your eval turns directly via Runner(app=app, session_service=InMemorySessionService()) — that should keep your ReflectAndRetryToolPlugin active and give you the retry behaviour you're expecting.

    If that works for your setup, the proper fix would need to thread the App reference through _generate_inferences_from_root_agent and use Runner(app=app) there instead.

    Could you give the workaround a try and confirm it resolves things on your end ?

  11. added
    request clarification
    and removed
    needs review
    on May 13, 2026
  12. surajksharma07 commented on May 25, 2026

    @surajksharma07
    Collaborator

    @klys-equinix Just checked the current source — LocalEvalService still only accepts root_agent in its constructor through v2.1.0, so the App bypass hasn't been fixed.
    EvaluationGenerator._generate_inferences_from_root_agent still constructs Runner(agent=root_agent) directly, meaning plugins on the App never fire during eval.

    PR #3836 by @ishanrajsingh was closed without merging, so the fix didn't land.

    If you'd like to upstream this, a fresh PR against the current codebase targeting LocalEvalService.init to accept an optional app parameter would be the right path.

    In the meantime, driving eval turns directly via Runner(app=app, session_service=InMemorySessionService()) is the best interim workaround to keep ReflectAndRetryToolPlugin active.

    Closing since there's been no update for two weeks — feel free to reopen with a repro or to track a new PR if you pick this up!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

evalrequest clarification

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions