{# One box of the agents view. Every value is autoescaped. #}
{% from "_status.html" import box_class, pct %}
{% set b = box %}
{% set has_sub = b.own.tokens != b.tokens %}
{% if b.type == "run" %}
{{ b.name or "(unnamed run)" }}separate run
{% elif b.type == "root" %}
main{{ b.name or "" }}
{% elif b.type == "pending" %}
agent {{ b.span_id }}node not received yet
{% else %}
{{ b.name if b.name is not none else "(unnamed)" }}{% if b.type == "node" %} graph node{% endif %}
{% if "name" in b.redacted %}name redacted{% endif %}
{% endif %}
{% if b.task %}{{ b.task }}{% endif %}
{% if "task" in b.redacted %}task redacted{% endif %}
{% if b.model %}{{ b.model }}{% if b.model_inferred %} (inferred){% endif %}{% endif %}
{{ b.status }}{{ b.duration_ms | duration }}
in {{ b.tokens_in | compact }} / out {{ b.tokens_out | compact }}{% if has_sub %} incl. sub-agents{% endif %}
{% if b.tokens_new_input is not none %}
new input {{ b.tokens_new_input | compact }}{% if b.tokens_cache_read is not none %} · cache read {{ b.tokens_cache_read | compact }}{% endif %}{% if b.tokens_cache_write is not none %} · cache write {{ b.tokens_cache_write | compact }}{% endif %}{% if b.cache_counts_exceed_input %} cache counts exceed input{% endif %}
{% endif %}
{{ b.llm_calls | number }} LLM{{ b.tool_calls | number }} tools{{ b.errors | number }} failure{% if b.errors != 1 %}s{% endif %}{% if b.error_events != b.errors %} ({{ b.error_events | number }} error events){% endif %}
{% if b.sub_agents %}incl. {{ b.sub_agents }} sub-agent{% if b.sub_agents != 1 %}s{% endif %}{% endif %}
{% if b.launched_from %}launched from {{ b.launched_from.name }}{% endif %}
{% if b.type != "run" and not has_sub %}{{ pct(b.own_share) }} of run{% endif %}
{% if b.type not in ("root", "run") and not has_sub %}{% endif %}
{% if has_sub and b.type != "run" %}
own in {{ b.own.tokens_in | compact }} / out {{ b.own.tokens_out | compact }} · {{ b.own.llm_calls | number }} LLM · {{ b.own.tool_calls | number }} tools{{ pct(b.own_share) }} of run own · {{ pct(b.share) }} with sub-agents
{% if b.type != "root" %}{% endif %}
{% endif %}
{% if b.status == "error" and b.status_message %}