{#- The Plan tab: the task's plan with its checkpoints, the bound agent's todo (a second layer, never merged into the plan) and the plan's history. Expects: t (the task), plan, todo, history, optional error. Refetched on live events. -#} {%- macro todo_items(items) -%}
    {% for i in items %}
  1. {{ i.subject }} {{ i.status|replace("_", " ") }}
  2. {% endfor %}
{%- endmacro -%} {%- macro todo_block(items, open) -%} {%- set now = items|selectattr("status", "equalto", "in_progress")|first %}
{% if now %}

Now doing: {{ now.active_form or now.subject }}

{% endif %}
Agent's todo {{ items|selectattr("status", "equalto", "completed")|list|length }}/{{ items|length }} {{ todo_items(items) }}
{%- endmacro -%} {%- set accepted = plan.status == "accepted" %} {%- set current = plan.current %}
{% if error %}{% endif %} {% if plan.steps %}
{{ "Accepted" if accepted else "Draft" }} {#- Each segment carries its own separator, so no text node is a bare " · " between two elements (an accessibility tree reads those as an empty segment). #} {{ plan.done }} of {{ plan.steps|length }} done {%- if plan.deviations %} · {{ plan.deviations }} deviation{{ "s" if plan.deviations > 1 else "" }}{% endif %} {%- if accepted and plan.accepted_by %} · accepted by {{ plan.accepted_by }}{% if plan.accepted_at %} {% endif %}{% endif %} {% if not accepted %}
{% endif %}
    {% for s in plan.steps %} {%- set is_current = current is not none and s.id == current.id %}
  1. {{ s.position }}. {{ s.title }} {{ s.status|replace("_", " ") }}
    {% if s.added_after_acceptance_at %}

    Added after acceptance by {{ s.added_by }} : {{ s.added_reason }}

    {% endif %} {% if s.details_md %}
    {{ s.details_md|markdown }}
    {% endif %} {% if s.status == "done" %}

    {{ s.conformance or "done" }} {%- if s.outcome %} · {{ s.outcome }}{% endif %} {%- if s.link %}{% set href = s.link|http_url %} · {% if href %}{{ href }}{% else %}report #{{ s.link[7:] }}{% endif %}{% endif %} {%- if s.done_at %} · {% endif %}

    {% elif s.outcome %}

    {{ s.outcome }}

    {% endif %} {% if is_current and todo %}{{ todo_block(todo, false) }}{% endif %}
  2. {% endfor %}
{% if todo and current is none %}{{ todo_block(todo, false) }}{% endif %} {% elif todo %}
Agent's plan, not accepted {{ t.session_name or "The bound session" }} keeps this todo in Claude Code; it is not the task's plan.
{{ todo_block(todo, true) }} {% else %}

No plan yet. The agent writes 2-5 steps with plan_set and marks them with plan_step_update; a small (S) task may go with the agent's todo only.

{% endif %} {% if history %}
History ({{ history|length }})
    {% for rev, diff in history %}
  1. #{{ rev.revision }} {{ rev.reason }} · {{ rev.author }} · {% if diff %}
    {% for line in diff %}{{ line }}
    {% endfor %}
    {% endif %}
  2. {% endfor %}
{% endif %}