eval: set USER_ERROR blame when AOAI run fails with UserError code#46746
Draft
eval: set USER_ERROR blame when AOAI run fails with UserError code#46746
Conversation
…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>
Copilot created this pull request from a session on behalf of
posaninagendra
May 6, 2026 05:40
View session
posaninagendra
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When an AOAI evaluation run ends in a non-
completedstatus, the exception was always raised withblame=UNKNOWN. If the run'serror.codeis"UserError", the blame should reflect that the failure is attributable to the user, not the system.Changes
_evaluate_aoai.py—_get_single_run_results: safely retrieverun_results.error.codevia nestedgetattrand assignErrorBlame.USER_ERRORwhen the code matches"usererror"(case-insensitive); falls back toUNKNOWNfor any other value, missing attribute, orNone.test_evaluate_aoai.py—TestGetSingleRunResultsBlame: five new unit tests covering:"UserError"/"usererror"/"USERERROR"/"uSeReRrOr"→USER_ERROR(parametrized)"SystemError") →UNKNOWNerrorattribute →UNKNOWNerrorpresent but nocodeattribute →UNKNOWNerror=None→UNKNOWN