Skip to content

eval: set USER_ERROR blame when AOAI run fails with UserError code#46746

Merged
posaninagendra merged 5 commits intomainfrom
copilot/update-error-blame-logic
May 6, 2026
Merged

eval: set USER_ERROR blame when AOAI run fails with UserError code#46746
posaninagendra merged 5 commits intomainfrom
copilot/update-error-blame-logic

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 6, 2026

  • Add CHANGELOG.md entry for case-insensitive UserError blame attribution fix in _get_single_run_results

…s + unit tests

Agent-Logs-Url: https://github.com/Azure/azure-sdk-for-python/sessions/85522f11-e665-4eb7-b1bc-05e48272e704

Co-authored-by: posaninagendra <2713981+posaninagendra@users.noreply.github.com>
posaninagendra
posaninagendra previously approved these changes May 6, 2026
…aluate_aoai

Agent-Logs-Url: https://github.com/Azure/azure-sdk-for-python/sessions/f4a706f3-5992-4bba-8ca8-21d3af1b16cb

Co-authored-by: posaninagendra <2713981+posaninagendra@users.noreply.github.com>
Copilot AI requested a review from posaninagendra May 6, 2026 17:09
@slister1001 slister1001 marked this pull request as ready for review May 6, 2026 19:24
@slister1001 slister1001 requested a review from a team as a code owner May 6, 2026 19:24
Copilot AI review requested due to automatic review settings May 6, 2026 19:24
slister1001
slister1001 previously approved these changes May 6, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves error attribution for Azure OpenAI (AOAI) evaluation runs by setting EvaluationException.blame to USER_ERROR when the run failure’s error.code indicates a user-caused issue (case-insensitive "UserError"), instead of always reporting UNKNOWN.

Changes:

  • Update _get_single_run_results to derive blame from run_results.error.code (nested getattr), mapping "usererror"ErrorBlame.USER_ERROR, otherwise ErrorBlame.UNKNOWN.
  • Add unit tests validating blame selection across casing variations and missing/partial error structures.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_evaluate/_evaluate_aoai.py Sets exception blame based on run_results.error.code when run status is non-completed.
sdk/evaluation/azure-ai-evaluation/tests/unittests/test_evaluate_aoai.py Adds unit tests to ensure blame is USER_ERROR only for "UserError" code and UNKNOWN otherwise.

…tion + changelog

Agent-Logs-Url: https://github.com/Azure/azure-sdk-for-python/sessions/e699106e-c9a8-428c-ac53-4d7a6729bb71

Co-authored-by: posaninagendra <2713981+posaninagendra@users.noreply.github.com>
slister1001
slister1001 previously approved these changes May 6, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 6, 2026

Hi @copilot. We've noticed that new changes have been pushed to this pull request. Because it is set to automatically merge, we've reset the approvals to allow the opportunity to review the updates.

@github-actions github-actions Bot dismissed stale reviews from posaninagendra, slister1001, and slister1001 May 6, 2026 19:34

Hi @posaninagendra. We've noticed that new changes have been pushed to this pull request. Because it is set to automatically merge, we've reset the approvals to allow the opportunity to review the updates.

slister1001
slister1001 previously approved these changes May 6, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 6, 2026

Hi @copilot. We've noticed that new changes have been pushed to this pull request. Because it is set to automatically merge, we've reset the approvals to allow the opportunity to review the updates.

@github-actions github-actions Bot dismissed slister1001’s stale review May 6, 2026 20:23

Hi @slister1001. We've noticed that new changes have been pushed to this pull request. Because it is set to automatically merge, we've reset the approvals to allow the opportunity to review the updates.

@posaninagendra posaninagendra merged commit b43c59c into main May 6, 2026
19 checks passed
@posaninagendra posaninagendra deleted the copilot/update-error-blame-logic branch May 6, 2026 21:08
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.

4 participants