{# Background-task status/result fragment. Included by workflow_detail.html and returned alone for HTMX polling (HX-Request). Polls while the derived status is running or awaiting approval; the terminal render drops the hx-* attributes, so outerHTML replacement stops the loop. #}

Background task

{{ task_status }} {% if can_cancel %} {% endif %}
{% if task_text %}

Task

{{ task_text }}
{% endif %} {% if approvals %}

Pending approvals

{% for a in approvals %}
{{ a.summary }}

Requested {{ a.created_at | timeago }} {% if a.effective_deadline %} · expires {{ a.effective_deadline | timeago }}{% endif %}

{% if a.non_ascii %}

Contains non-ASCII characters; check the command for lookalikes.

{% endif %}
{{ a.detail }}
{% endfor %} {% endif %} {% if approval_window_closed %}

The approval window has closed; the task is stopping.

{% endif %}

Answer

{% if answer_html %}
{{ answer_html | safe }}
{% elif task_status == 'awaiting approval' %}

Waiting for your approval above.

{% elif task_status == 'running' %}

The answer appears here when the task finishes.

{% else %}

No answer was stored for this task.

{% endif %} {% if task_session_pk %}

Open the full session transcript →

{% endif %}