Asked about Seeing what the system did

How do you debug an agent that behaved oddly in production?

An answer that works

Pull the trace for that run. Read what was actually sent at each turn, which tools were called with which arguments, what came back, and where it diverged. Most surprising behaviour is obvious once you see the rendered prompt rather than the template.

Reading an answer is not being able to give one. The section that teaches this is Seeing what the system did, 4 hours of Tracing & observability.

Learn this properly