How do I read a trace to find why a run failed?
Start at the bad output and walk back span by span to the first step whose output was wrong given what it received. That step is where the run failed, and it can sit several spans before the one where the failure showed.
At each span the question is the same: was the input right, and was the output right for that input? On a model call, read what was actually in its context. If the fact it needed was missing, the failure is upstream, in retrieval or an earlier tool call. If the fact was there and the model got it wrong, the failure is in that call, whether it misread the source or ignored it. On a tool call, check the arguments the model sent and the result that came back, because a tool can succeed and still return the wrong data.
In a multi-agent run, check each handoff the same way.
If the first wrong step seems to fall between two spans, look for a step the code never emitted, since the trace holds only what was instrumented.
published