-
Notifications
You must be signed in to change notification settings - Fork 71
feat(eval): capture the detail of every failing run, not just the winning one #1816
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Tomkess
wants to merge
6
commits into
master
Choose a base branch
from
feat/per-run-failure-capture
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
4378519
feat(eval): capture the detail of every failing run, not just the win…
Tomkess 4d0e0ac
style(gooddata-eval): collapse _failed_run_record signature to satisf…
Tomkess c395483
feat(eval): capture failing runs for the agentic kinds too, not just …
Tomkess 545ebb9
fix(eval): keep the per-run records when every run went ungraded
Tomkess 740e52a
fix(eval): type _attach_diagnostics against the errors it actually re…
Tomkess 66ee5a6
test(eval): pin the all-ungraded path for general_question behaviourally
Tomkess File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
62 changes: 62 additions & 0 deletions
62
packages/gooddata-eval/src/gooddata_eval/core/agentic/_failed_runs.py
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| # (C) 2026 GoodData Corporation. All rights reserved. | ||
| """Per-run failure records for the agentic evaluators. | ||
|
|
||
| ``core/runner.py`` records one of these for every failing run of a single-shot item. The | ||
| agentic kinds cannot reuse it: each of them drives its own K-loop inside the evaluator and | ||
| hands ``cli/agentic_runner`` a single aggregate per item, so by the time the runner sees | ||
| the result the individual attempts are already collapsed into ``best``. The runs themselves | ||
| are not lost -- every kind keeps its ``run_results`` list -- they simply never leave the | ||
| evaluator. This turns that list into the same records the single-shot path writes. | ||
|
|
||
| Keys mirror ``core.runner._failed_run_record`` so one consumer can read ``failed_runs`` from | ||
| either path without branching on test kind. ``tool_call_count``/``tool_names`` are the | ||
| addition: the agentic kinds capture tool calls per run, and an agent that produced a final | ||
| answer having made no tool call at all answered from the model's own knowledge rather than | ||
| from the workspace -- a distinction no other recorded field exposes. | ||
| """ | ||
|
|
||
| from __future__ import annotations | ||
|
|
||
| from collections.abc import Callable, Sequence | ||
| from typing import Any | ||
|
|
||
|
|
||
| def build_failed_runs( | ||
| run_results: Sequence[Any], | ||
| *, | ||
| passed: Callable[[Any], bool], | ||
| detail: Callable[[Any], dict], | ||
| ) -> list[dict]: | ||
| """One record per run that did not pass, in the order the runs happened. | ||
|
|
||
| ``passed`` and ``detail`` are supplied by the caller because neither is uniform across | ||
| kinds: guardrail reads ``run.passed`` while visualization reads | ||
| ``run.eval_result.strict_pass``, and each kind's diagnostic dict is its own. Everything | ||
| read here directly goes through ``getattr`` with a default, so a kind whose run result | ||
| lacks a field (no response id, no tool capture) records a null instead of raising. | ||
|
|
||
| A run the judge could not grade is recorded like any other non-passing run, with its | ||
| ``error`` set. That matches ``core/runner.py``, which also records ungraded runs; the | ||
| verdict-level accounting of ungraded runs stays with the caller's ``unscored_runs``. | ||
| """ | ||
| records: list[dict] = [] | ||
| for run_index, run in enumerate(run_results, start=1): | ||
| if passed(run): | ||
| continue | ||
| tool_calls = list(getattr(run, "tool_call_events", None) or []) | ||
| reasoning_steps = list(getattr(run, "reasoning_steps", None) or []) | ||
| records.append( | ||
| { | ||
| "run_index": run_index, | ||
| "passed": False, | ||
| "error": getattr(run, "judge_error", None), | ||
| "detail": detail(run), | ||
| "conversation_id": getattr(run, "conversation_id", None), | ||
| "response_id": getattr(run, "response_id", None), | ||
| "reasoning_step_count": len(reasoning_steps), | ||
| "reasoning_steps": reasoning_steps, | ||
| "tool_call_count": len(tool_calls), | ||
| "tool_names": [getattr(e, "function_name", None) for e in tool_calls], | ||
| } | ||
| ) | ||
| return records |
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.