{% if ex.role == "assistant" %} assistant {% elif ex.role == "system" %} system {% else %} user {% endif %} #{{ ex.idx }} {% if ex.model %}{{ ex.model }}{% endif %} {% if ex.stop_reason and ex.stop_reason != "end_turn" %} {{ ex.stop_reason }} {% endif %}
{% if ex.thinking %}
thinking ({{ ex.thinking|length }} chars)
{{ ex.thinking }}
{% endif %} {% if ex.text %}
{{ ex.text|markdown }}
{% endif %} {% for tc in ex.tool_calls %}
{{ tc.name }} {{ tc.summary }} {% if not tc.has_result %}no result {% elif tc.result_is_error %}error{% endif %}
input
{{ tc.input_json }}
{% if tc.has_result and tc.result_content %}
result ({{ tc.result_content|length }} chars)
{{ tc.result_content }}
{% endif %} {% if tc.sub_exchanges %} {% set _n = namespace(tools=0) %} {% for sx in tc.sub_exchanges %}{% set _n.tools = _n.tools + sx.tool_calls|length %}{% endfor %}
↓ subagent — {{ tc.sub_exchanges|length }} exchanges · {{ _n.tools }} tool calls
{% for sub_ex in tc.sub_exchanges %} {% with ex = sub_ex %}{% include "_turn.html" %}{% endwith %} {% endfor %}
{% endif %}
{% endfor %}