{#- Failures first: what broke, how often, and whether the turn survived. Built from the timeline's rows, so scoping and the content mode already apply; the error text itself stays behind the same audited reveal as the timeline. -#} {% set failures = (trace_timeline or {}).get('failures') %} {% set can_reveal_failure = trace_permissions and trace_permissions['trace.reveal'] and trace_content_mode != 'metadata' %} {% if failures and (trace_timeline.rows or selected_root_trace_id) %}
{% if failures.total %}

{{ failures.total }} failure{{ '' if failures.total == 1 else 's' }} in {{ failures.turns }} turn{{ '' if failures.turns == 1 else 's' }}

{% if failures.stopped %}{{ failures.stopped }} turn{{ ' was' if failures.stopped == 1 else 's were' }} stopped or did not finish.{% else %}The agent carried on and finished {{ 'it' if failures.turns == 1 else 'all of them' }}.{% endif %}

{% else %}

No failures in {{ trace_timeline.rows|length }} recorded event{{ '' if trace_timeline.rows|length == 1 else 's' }}{% if selected_root_trace_id %} for this turn{% endif %}.

{% endif %} {% if selected_root_trace_id %}Show every turn for this agent{% endif %}
{% endif %}