You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Merge google#4413
**Please ensure you have read the [contribution guide](https://github.com/google/adk-python/blob/main/CONTRIBUTING.md) before creating a pull request.**
### Link to Issue or Description of Change
**1. Link to an existing issue (if applicable):**
- Related: google#4410
**Problem:**
`adk eval` only resolved `agent.root_agent`, while `AgentEvaluator` supports both `root_agent` and `get_agent_async`. This inconsistency caused valid agent modules (for `AgentEvaluator`) to fail in CLI evaluation.
**Solution:**
Aligned `adk eval` agent resolution with `AgentEvaluator` by updating CLI loading logic to support both entry points:
- `root_agent`
- `get_agent_async`
Implementation details:
- Made `get_root_agent` in `cli_eval.py` asynchronous and added fallback resolution to `get_agent_async`.
- Updated `cli_tools_click.py` to call `get_root_agent` via `asyncio.run(...)`.
- Added/updated unit tests for both resolution paths and the error path when neither is present.
### Testing Plan
**Unit Tests:**
- [x] I have added or updated unit tests for my change.
- [x] All unit tests pass locally.
```
% pytest tests/unittests/cli
========================= 271 passed, 140 warnings in 7.69s =========================
```
**Manual End-to-End (E2E) Tests:**
No manual E2E test was run for this PR.
### Checklist
- [x] I have read the [CONTRIBUTING.md](https://github.com/google/adk-python/blob/main/CONTRIBUTING.md) document.
- [x] I have performed a self-review of my own code.
- [x] I have commented my code, particularly in hard-to-understand areas.
- [x] I have added tests that prove my fix is effective or that my feature works.
- [x] New and existing unit tests pass locally with my changes.
- [ ] I have manually tested my changes end-to-end.
- [x] Any dependent changes have been merged and published in downstream modules.
### Additional context
This PR focuses on one scoped item from google#4410: agent resolution parity between `adk eval` and `AgentEvaluator` (`root_agent` / `get_agent_async`).
Co-authored-by: George Weale <gweale@google.com>
COPYBARA_INTEGRATE_REVIEW=google#4413 from ftnext:adk-eval-get-agent-async 267c196
PiperOrigin-RevId: 952361014
0 commit comments