By Abhijith N M · Reviewed 24 October 2026 · Editorial standards
An agent's final message is a summary written by the agent. The trace is what actually happened: every tool call, its arguments, its result, and the time it took. When an agent misbehaves, the trace is the only reliable evidence — and it is also what your tests assert against.
| Field | Why |
|---|---|
| span_id + parent_id | Rebuilds the tree of what caused what |
| tool name + arguments (redacted) | The action taken, and on which entity |
| tool result status | Distinguishes 'tool failed' from 'agent ignored the result' |
| tokens + latency per span | Finds the expensive and slow step |
| step index | Detects loops and bloated runs |
def loop_suspected(tools: list[str], repeat: int = 3) -> bool:
run_tool, run_len = None, 0
for tool in tools:
run_len = run_len + 1 if tool == run_tool else 1
run_tool = tool
if run_len >= repeat:
return True
return False
# Alert on: share of conversations with loop_suspected(trace) > 1%
# Or: p95 steps per conversation > 8Thumbs up/down is noisy but not useless. Treat it as a sampling tool, not a score: collect all negative feedback, judge those conversations with your rubric, and look for a pattern. Three thumbs-down on the same intent is a real bug; one is an opinion.
Key takeaways
The trace, not the message, is the record of what an agent did.
Capture per span: tool, arguments, result status, tokens, latency, step index.
Watch steps per conversation, tool error rate and completion rate.
Treat thumbs-down as a sampler for investigation, not a quality score.
Written and edited by the nexGenCoders team. Spotted a mistake? Tell us and we will fix it.
Don't lose this lesson
Create a free account to save your progress, keep your streak, and work toward a shareable certificate.