{#- A task's comment thread, refetched on live events. Expects: t (the task), comments, optional error, doc_refs (board targets of document links) and wait_reason (why undelivered comments wait). The form that adds a comment lives outside it (_comment_form.html), so a draft survives. -#} {%- macro stamp(ts) -%}{%- endmacro -%}
{{ error }}
{% endif %} {#- Comments on review steps and the replies to them live in the step's own thread (Review). #} {%- set ns = namespace(step=[]) %} {%- for c in comments %}{% if c.step_id or c.in_reply_to in ns.step %}{% set ns.step = ns.step + [c.id] %}{% endif %}{% endfor %} {%- set shown = comments|rejectattr("id", "in", ns.step)|list %} {% if ns.step %}{{ ns.step|length }} comment{{ "s" if ns.step|length != 1 else "" }} on review steps: see the Review tab.
{% endif %} {% if shown %}{% if wait_reason %}A new comment waits: {{ wait_reason }}.{% else %}A new comment reaches {{ t.session_name }} through its hooks on its next prompt or tool call.{% endif %}
{{ c.body_md }}
{% else %}{%- if c.to_agent %} sent {{ stamp(c.created_at) }} {%- if c.delivered_at %} · delivered {{ stamp(c.delivered_at) }} {%- else %} · not delivered yet{% if wait_reason %}: {{ wait_reason }}{% endif %}{% endif %} {%- if c.read_at %} · read {{ stamp(c.read_at) }}{% endif %} {%- else %} reply {{ stamp(c.created_at) }} {%- if not c.read_at %} · unread{% endif %} {%- endif %}