Commit 4e6872c
committed
fix(gooddata-eval): don't feed fallback-trace latency into KDA value_score
_select_kda_trace falls back to the max-latency candidate only so scores
still attach to a real trace instead of being orphaned when KDA never
triggered -- that fallback trace's latency/cost are not meaningful KDA
numbers (previous comment said so but the caller still passed pt.latency
into log_quality_and_value_scores regardless, contaminating value_score
with an unrelated turn's duration).
Gate on ev.kda_triggered (our own tool-call extraction, not Langfuse) before
trusting pt.latency/pt.total_cost. When kda_triggered is False, pass None so
log_quality_and_value_scores' own worst-case default (speed=0) applies,
which is the correct outcome for a case that never triggered KDA at all.
Verified offline: a never-triggered case with a mocked fallback trace
(latency=999.0, totalCost=5.0) now logs latency_sec=None/cost_usd=None
instead of leaking those numbers into value_score.
JIRA: QA-28800
risk: nonprod1 parent 361590a commit 4e6872c
1 file changed
Lines changed: 7 additions & 4 deletions
Lines changed: 7 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
156 | 156 | | |
157 | 157 | | |
158 | 158 | | |
159 | | - | |
160 | | - | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
161 | 162 | | |
162 | 163 | | |
163 | 164 | | |
| |||
433 | 434 | | |
434 | 435 | | |
435 | 436 | | |
| 437 | + | |
| 438 | + | |
436 | 439 | | |
437 | 440 | | |
438 | 441 | | |
439 | 442 | | |
440 | | - | |
441 | | - | |
| 443 | + | |
| 444 | + | |
442 | 445 | | |
443 | 446 | | |
444 | 447 | | |
| |||
0 commit comments