Skip to content

fix(eval): support azd ai agent eval generate with init fallback#320

Merged
placerda merged 1 commit into
developfrom
feature/azd-eval-generate-fallback
Jun 17, 2026
Merged

fix(eval): support azd ai agent eval generate with init fallback#320
placerda merged 1 commit into
developfrom
feature/azd-eval-generate-fallback

Conversation

@placerda

Copy link
Copy Markdown
Contributor

Summary

Fixes agentops eval init hard-failing on the azure.ai.agents azd extension 0.1.40, which renamed the eval subcommand azd ai agent eval init -> azd ai agent eval generate.

Repro on 0.1.40:

Error: azd ai agent eval init failed: Command "init" is deprecated, use 'azd ai agent eval generate' instead

Change

  • run_azd_eval_init now builds the command without a hardcoded subcommand and delegates to a new _run_eval_subcommand helper that:
    • tries generate first (extension >= 0.1.40),
    • falls back to the legacy init only when the extension reports the subcommand name as unknown/unrecognized/deprecated (centralized, unit-tested _eval_subcommand_unsupported matcher),
    • surfaces genuine failures (auth, endpoint, timeout) immediately instead of masking them.
  • All previously passed flags (--project-endpoint, --agent, --gen-instruction-file, --eval-model, --dataset, repeated --evaluator) and recipe discovery/persistence are preserved.

Tests

  • Updated existing argv assertions (init -> generate).
  • Added: new-extension success (init never called), old-extension fallback (asserts both argvs + identical flags), deprecation-not-hard-fail, genuine-error-passthrough, and a _eval_subcommand_unsupported truth-table test.
  • Full suite green (uv run pytest tests/), ruff check clean, mypy clean.

Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com

azure.ai.agents extension 0.1.40 renamed 'azd ai agent eval init' to
'azd ai agent eval generate', causing 'agentops eval init' to hard-fail
on the deprecation error. run_azd_eval_init now tries 'generate' first
and falls back to the legacy 'init' subcommand only when the installed
extension reports the subcommand name as unknown/unrecognized/deprecated.
Genuine failures (auth, endpoint, timeout) are surfaced immediately. All
preserved flags and recipe discovery/persistence behaviour are unchanged.

Adds _eval_subcommand_unsupported / _run_eval_subcommand helpers and unit
tests covering the new-extension, old-extension fallback, deprecation, and
real-error-passthrough paths.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@placerda placerda merged commit 8a1b119 into develop Jun 17, 2026
9 checks passed
@placerda placerda mentioned this pull request Jun 17, 2026
@placerda placerda deleted the feature/azd-eval-generate-fallback branch June 17, 2026 11:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant