Commit 1bdff0c
fix(eval): flush span processors before reading execution trace
_get_and_clear_execution_data() read ExecutionSpanExporter.get_spans()
without first flushing the batch span processor. The flush triggered by
the root execution span ending only exports spans whose on_end() already
fired by that moment, so a tool-call span finishing a beat later (e.g. a
detached background task) could still be queued, unexported, and missing
from AgentRunHistory when the evaluator reads the trace (UV-16309).
Force a flush immediately before the read so every span that has ended
by then is guaranteed to be exported first.
See UV-16309 and the repro test in
test/uv-16309-span-flush-race (test_execution_span_race.py).
Co-Authored-By: Claude Sonnet 5 <[email protected]>1 parent 611fe7d commit 1bdff0c
1 file changed
Lines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
970 | 970 | | |
971 | 971 | | |
972 | 972 | | |
| 973 | + | |
| 974 | + | |
| 975 | + | |
| 976 | + | |
| 977 | + | |
| 978 | + | |
| 979 | + | |
973 | 980 | | |
974 | 981 | | |
975 | 982 | | |
| |||
0 commit comments