Repository navigation
Commit c41f542
refactor(gooddata-eval): centralize agentic outcome fields; fix exit_reason and tool_calls gaps (#1846)
Comprehensive analysis of the 11 agentic evaluators (alert_skill, anomaly_detection,
conversation, dashboard_skill, general_question, guardrail, kda_skill, metric_skill,
search_tool, visualization, what_if) found the same unfinished-rollout pattern that
caused best_run_latency_s (#1845) recurring twice more, live in production data:
1. exit_reason (LoopExit) -- invented specifically so a run that hit max_iterations
stops looking identical to a genuine refusal -- was wired into 5 of 8 multi-turn
kinds. Missing from anomaly_detection, dashboard_skill, what_if. All three now
track it through every break point in their run loop (SUCCESS/AGENT_SILENT/
CHAT_ERROR/SIMULATED_USER_FAILED/BUDGET_EXHAUSTED default), mirroring the exact
pattern already proven in kda_skill.py/alert_skill.py.
2. detail's tool_calls key -- timeline_detail() builds both latency_breakdown and
tool_calls from the same events so they stay index-aligned, but roughly half the
evaluators called build_latency_breakdown() directly and silently never got a
tool_calls key. Every evaluator's detail dict now goes through one shared
`agentic_detail()` call, so this can't happen again by omission.
3. The root cause of 1 and 2 (and best_run_latency_s before them): every evaluator
hand-wrote the same ~7-10 line block copying reasoning_steps/conversation_id/
response_id/detail/runs_passed/runs_effective/(timings)/best_run_latency_s either
onto a raised exception or into the returned AgenticEvalOutcome -- 11 independent
copies of the same logic, so a new universal field needed 11 edits, and nothing
failed loudly when one was missed (AgenticAssertionError's own docstring already
documents this happening once before, to `.timings`).
New core/agentic/_outcome.py centralizes it: `agentic_detail()` for the detail
dict, `raise_agentic_failure()`/`agentic_success()` for the common fields. All 11
evaluators now call these instead of hand-rolling. Per-evaluator duplicate field
assignments: ~85 lines total before, 3 after (the 2 remaining are general_question's
and guardrail's "no judge verdict at all" branches, which raise a bare
JudgeResponseError -- not an AgenticAssertionError subclass, so they can't route
through raise_agentic_failure; left as direct attribute sets, same as before).
Explicitly NOT addressed here (see PR description for why):
- agentic_dashboard_summary not existing on master at all -- it's part of a much
larger (2000+ line) unmerged integration branch with its own in-flight PRs; porting
it here would duplicate/conflict with that separate effort.
- A ~9% gap in agentic_guardrail's .reasoning.json sidecar capture for runs that did
have reasoning steps -- traced as far as ruling out config differences and SSE-level
field divergence (reasoningSteps/reasoningStepEvents are built from the same
accumulator list, so they can't diverge there), but the remaining cause needs a live
repro with real reasoning content, not static source reading.
Verified: full gooddata-eval suite (1382 passed), ruff lint/format, and ty type-check
all clean. New/extended tests assert real exit_reason values (not just that nothing
broke) for every break point added, plus tool_calls presence, across all three
newly-covered kinds.
Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>1 parent 4216bed commit c41f542
18 files changed
Lines changed: 483 additions & 275 deletions
File tree
- packages/gooddata-eval
- src/gooddata_eval/core/agentic
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
| |||
40 | 41 | | |
41 | 42 | | |
42 | 43 | | |
43 | | - | |
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| |||
951 | 951 | | |
952 | 952 | | |
953 | 953 | | |
954 | | - | |
955 | | - | |
956 | | - | |
957 | | - | |
958 | | - | |
959 | | - | |
960 | | - | |
961 | | - | |
962 | | - | |
963 | | - | |
964 | | - | |
| 954 | + | |
| 955 | + | |
| 956 | + | |
| 957 | + | |
| 958 | + | |
| 959 | + | |
| 960 | + | |
| 961 | + | |
| 962 | + | |
| 963 | + | |
| 964 | + | |
| 965 | + | |
| 966 | + | |
965 | 967 | | |
966 | 968 | | |
967 | | - | |
968 | | - | |
969 | | - | |
970 | | - | |
971 | | - | |
| 969 | + | |
| 970 | + | |
| 971 | + | |
| 972 | + | |
972 | 973 | | |
973 | 974 | | |
974 | 975 | | |
975 | | - | |
| 976 | + | |
| 977 | + | |
976 | 978 | | |
977 | 979 | | |
978 | 980 | | |
979 | 981 | | |
980 | 982 | | |
981 | 983 | | |
982 | 984 | | |
983 | | - | |
| 985 | + | |
| 986 | + | |
| 987 | + | |
| 988 | + | |
| 989 | + | |
| 990 | + | |
| 991 | + | |
| 992 | + | |
984 | 993 | | |
985 | | - | |
986 | | - | |
987 | | - | |
988 | | - | |
989 | | - | |
990 | | - | |
991 | | - | |
992 | | - | |
993 | | - | |
994 | | - | |
995 | | - | |
| 994 | + | |
996 | 995 | | |
997 | 996 | | |
998 | 997 | | |
999 | 998 | | |
| 999 | + | |
| 1000 | + | |
1000 | 1001 | | |
1001 | 1002 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| 43 | + | |
43 | 44 | | |
44 | 45 | | |
45 | 46 | | |
| |||
56 | 57 | | |
57 | 58 | | |
58 | 59 | | |
| 60 | + | |
59 | 61 | | |
60 | 62 | | |
61 | | - | |
62 | 63 | | |
63 | 64 | | |
64 | 65 | | |
| |||
287 | 288 | | |
288 | 289 | | |
289 | 290 | | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
290 | 295 | | |
291 | 296 | | |
292 | 297 | | |
| |||
391 | 396 | | |
392 | 397 | | |
393 | 398 | | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
394 | 403 | | |
395 | 404 | | |
396 | 405 | | |
| |||
403 | 412 | | |
404 | 413 | | |
405 | 414 | | |
| 415 | + | |
406 | 416 | | |
407 | 417 | | |
408 | 418 | | |
| |||
416 | 426 | | |
417 | 427 | | |
418 | 428 | | |
| 429 | + | |
419 | 430 | | |
420 | 431 | | |
| 432 | + | |
421 | 433 | | |
422 | 434 | | |
423 | 435 | | |
| |||
426 | 438 | | |
427 | 439 | | |
428 | 440 | | |
| 441 | + | |
429 | 442 | | |
430 | 443 | | |
431 | 444 | | |
| |||
434 | 447 | | |
435 | 448 | | |
436 | 449 | | |
| 450 | + | |
437 | 451 | | |
438 | 452 | | |
439 | 453 | | |
| |||
487 | 501 | | |
488 | 502 | | |
489 | 503 | | |
490 | | - | |
491 | | - | |
492 | | - | |
493 | | - | |
494 | | - | |
495 | | - | |
496 | | - | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
497 | 513 | | |
498 | 514 | | |
499 | | - | |
500 | | - | |
501 | | - | |
502 | | - | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
503 | 519 | | |
504 | 520 | | |
505 | | - | |
506 | | - | |
507 | | - | |
508 | | - | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
509 | 527 | | |
510 | 528 | | |
511 | 529 | | |
| |||
630 | 648 | | |
631 | 649 | | |
632 | 650 | | |
633 | | - | |
634 | | - | |
635 | | - | |
636 | | - | |
637 | | - | |
638 | | - | |
639 | | - | |
640 | | - | |
641 | | - | |
642 | | - | |
643 | | - | |
644 | | - | |
645 | | - | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
646 | 664 | | |
647 | 665 | | |
648 | 666 | | |
649 | 667 | | |
| 668 | + | |
| 669 | + | |
650 | 670 | | |
651 | 671 | | |
0 commit comments