-
[OPIK-5605] Fix duplicated Online Scoring evaluations for partial traces (#6049)
发布于
2026-04-02 10:44:55 +00:00 - [OPIK-5605] Fix duplicated Online Scoring evaluations for partial traces
The SDK sends two POST /traces/batch calls per trace when
log_start_trace_span=True (default): one at function start (no output/
end_time) and one at function end (complete). Both fired TracesCreated
events, causing OnlineScoringSampler to score each trace twice — once
with empty template variables and once correctly.Filter out partial traces (endTime == null) in onTracesCreated() so only
complete traces are sampled and scored.- [OPIK-5605] Fix OnlineScoringEngineTest for partial trace filtering
Add endTime to createTrace() helper so existing tests use complete
traces. Add new test that sends a partial trace (no end_time), waits
2s, then sends the complete trace — verifies scoring happens exactly
once with no duplicate executions.下载附件