{#- The Coordinator page's live part (design 0023): refetched whole by app.js on the events it shows, held while an answer or the owner's text is being typed. Expects: c (CoordinatorPage), before (the page of turns, None: the newest), available, running, desktop_ok, terminal_on, terminal_open. -#} {% from "_question_item.html" import question_item %} {% from "_approval_item.html" import approval_item %} {%- macro hidden_csrf() -%}{%- endmacro %} {%- macro act(action, label, kind="") -%}
{{ hidden_csrf() }}
{%- endmacro %} {%- set r = c.view.run if c.view else none %} {%- set open = r is not none and r.is_open %} {%- set b = c.wake.budget %} {%- set keys = (c.started|map(attribute="task_key")|select|list) + (c.approvals|map(attribute="task_key")|list) %}
{% if not available %}

Runs need a server started by relaybay serve or the program.

{% endif %} {% if r is none %}

No coordinator yet. One coordinator for all projects: a run of your own claude without a card, in a folder of its own outside any git repository. It plans and drives the tasks on this board through relaybay's tools; it never approves and never answers your questions for you.

Start makes it ready without a turn and without tokens{% if c.folder %}, in {{ c.folder }} (made on Start, with a starter CLAUDE.md you may replace){% endif %}. Your text in its box, or the first wake by events on the board, is its first turn; between wakes no process runs.{% if c.folder_note %} {{ c.folder_note }}{% endif %}

{% elif not open %}

Ended (run {{ r.id }}, ). Start makes a new run in {% if c.folder %}{{ c.folder }}{% else %}its folder{% endif %}; its CLAUDE.md, relaybay's memory and its open questions carry over. Events wait for it meanwhile.

{% elif r.with_owner or terminal_open %}

With you {% if terminal_open or r.in_terminal %}in the Terminal tab{% else %}in the desktop app{% endif %}. Wakes and your text below wait until it is back with the program{% if not terminal_open %} (Back to the program){% endif %}.

{% elif r.status == "stopped" %}

Stopped. Its turn was stopped and wakes wait: your next text in the box goes on.

{% elif c.wake.held and c.wake.held.startswith("over its stop budget") %} {% endif %}
Status
{% if open %}{{ r.status }}{% if r.with_owner %} with the owner{% endif %}{% if r.status_reason %} {{ r.status_reason }}{% endif %}{% elif r %}ended{% else %}not started{% endif %}
{% if r %}
Session
run {{ r.id }}{% if r.session_name %} · {{ r.session_name }}{% endif %} · {{ r.claude_session_id or "Claude session not known yet" }}{% if r.desktop_link %} open in the Claude desktop app{% endif %}
Context
{% if c.wake.context_tokens is not none %}{{ "{:,}".format(c.wake.context_tokens) }} tokens after its last turn{% else %}no turn yet{% endif %} · /compact above {{ "{:,}".format(c.settings.compact_at_tokens) }}
Today
{% if b %}{{ "{:,}".format(b.used) }} of {{ "{:,}".format(b.budget.max_tokens) }} tokens this UTC day ({{ b.percent }}%){% if b.level == "exceeded" %} over its daily budget{% if b.budget.action == "stop" %}: wakes stop{% endif %}{% elif b.level == "warned" %} over 80% of its daily budget{% endif %}{% else %}{{ "{:,}".format(c.wake.today_tokens) }} tokens this UTC day (no budget: Start makes one from Settings → Agents){% endif %} · {{ "{:,}".format(c.view.totals.tokens) }} in this run
{% endif %}
Events waiting
{{ c.wake.waiting }}{% if c.wake.held %} {{ c.wake.held }}{% elif c.wake.waiting %} for the next wake{% endif %} · a wake at most every {{ c.settings.wake_gap_seconds }} s
Folder
{% if open %}{{ r.cwd }}{% elif c.folder %}{{ c.folder }} (made on Start){% else %}-{% endif %}{% if c.folder_note and open %} {{ c.folder_note }}{% endif %}
Settings
{% if r %}{{ r.model }} · {{ r.effort }} · {{ r.permission_mode }} · profile {{ r.profile }}{% else %}profile {{ c.settings.profile }} · {{ c.settings.model }} · {{ c.settings.effort }}{% endif %} change in Settings → Agents
{% if c.refusal and not open %}{% endif %}
{% if not open %} {{ act("start", "Start", "primary") }} {% else %} {% if r.status == "queued" and not r.with_owner %}{{ act("anyway", "Start anyway", "primary") }}{% endif %} {% if running %}{{ act("stop", "Stop", "danger") }}{% endif %} {% if terminal_on and r.claude_session_id and not r.with_owner and not running and r.status != "running" %}Terminal{% endif %} {% if desktop_ok and r.claude_session_id and not r.with_owner and not running and r.status != "running" %}{{ act("desktop", "Open in the desktop app") }}{% endif %} {% if r.with_owner and not terminal_open %}{{ act("back", "Back to the program") }}{% endif %} {{ act("new-session", "New session") }} {{ act("end", "End", "danger") }} {% endif %}
{% if open %}
{{ hidden_csrf() }}

Sent as a turn framed as yours: "The owner says on the board: …". Everything else the coordinator reads is data. While a turn runs, or while it is with you in the terminal or the desktop app, the text waits.

{% endif %}

What waits for you{% if c.questions or c.approvals %} {{ c.questions|length + c.approvals|length }}{% endif %}

{% if c.questions %}

Its questions

{% endif %} {% if c.approvals %}

Approvals of the runs it started

{% endif %} {% if not c.questions and not c.approvals %}

Nothing: no open question of its own and no approval asked by a run it started.

{% endif %} {% if c.answered %}
Its closed questions ({{ c.answered|length }})
    {% for q in c.answered %}{{ question_item(q, "coordinator") }}{% endfor %}
{% endif %}

What came in and what it decided

{% if c.view and c.view.turns %} {% if c.paged %}

Newest turns

{% endif %}
    {% for turn in c.view.turns|reverse %} {%- set w = c.wakes.get(turn.id) %} {%- set k = c.compacted.get(turn.id) %} {%- set compact = turn.prompt.strip() == "/compact" %} {%- set said = turn.prompt|owner_words if turn.sent_by_kind == "owner" else none %}
  1. {% if w %}wake{% elif compact %}relaybay{% elif turn.sent_by_kind == "owner" %}the owner{% else %}{{ turn.sent_by }}{% endif %} {{ turn.state|replace("_", " ") }} turn {{ turn.seq }} · · {{ "{:,}".format(turn.tokens) }} tokens{% if turn.denials %} · {{ turn.denials }} denied{% endif %}

    Came in

    {% if w %}

    {{ w.count }} event{{ "" if w.count == 1 else "s" }}

      {% for line in turn.prompt|wake_lines %}
    • {{ line[2:] if line.startswith("- ") else line }}
    • {% endfor %}
    {% elif compact %}

    /compact sent by relaybay: its context passed {{ "{:,}".format(c.settings.compact_at_tokens) }} tokens

    {% elif said is not none %}

    {{ said }}

    {% else %}

    {{ turn.prompt|truncate(600) }}

    {% endif %} {% if not compact %}
    Its whole text
    {{ turn.prompt }}
    {% endif %}

    Decided

    {% if k %}

    compacted: {{ "{:,}".format(k[0]) }} -> {% if k[1] is not none %}{{ "{:,}".format(k[1]) }}{% else %}?{% endif %} tokens

    {% endif %} {% if turn.result_md %}
    {{ turn.result_md|markdown }}
    {% elif turn.ended_at %}

    No result text.

    {% else %}

    {{ "Runs now." if turn.started_at else "Waits to run." }}

    {% endif %}
  2. {% endfor %}
{% if c.older %}

Older turns

{% endif %} {% elif r %}

No turn yet: your text or the first wake is its first turn.

{% else %}

Its wakes, your words and what it decided show here once it runs.

{% endif %}

Runs it started today{% if c.started %} {{ c.started|length }}{% endif %}

{% if c.started %}
{% for s in c.started %} {% endfor %}
CardTitleStatusStartedTokens
{% if s.task_key %}{{ s.task_key }}{% else %}{{ s.kind }} on {{ s.project_slug }}{% endif %} {{ (s.task_title or "") |truncate(80) }} {{ s.status }} run {{ s.id }} {{ "{:,}".format(s.tokens) }}
{% else %}

None today. It starts runs with run_start on cards in plan or dev, within the slots, the budgets and its profile's daily cap.

{% endif %}

Its schedules{% if c.schedules %} {{ c.schedules|length }}{% endif %}

{% if c.schedules %}

All schedules

{% else %}

No coordinator turns on a schedule and none it made. The owner adds them on Schedules; the coordinator adds one-off checks and reminders with schedule_add.

{% endif %}