{% extends "base.html" %} {% block title %}Scheduler — Agent Wasp{% endblock %} {% block page_css %} {% endblock %} {% block content %} {# ── Header ──────────────────────────────────────────────────────────── #}

Scheduler

Background jobs that keep the agent alive and learning

{# Live stats bar #}
{{ total }} jobs
{{ running }} running
{{ paused }} paused
{{ failed }} failed
{% if not jobs %}

No scheduled jobs

Jobs appear after the agent scheduler starts.

{% else %} {# ── Job groups ─────────────────────────────────────────────────────── #}
{% for cat_key, cat_jobs in groups %} {% set cm = cat_meta[cat_key] if cat_key in cat_meta else {"label": cat_key|title, "color": "#6366f1"} %}
{# Section header #}
{{ cm.label }} {{ cat_jobs|length }}
{% for job in cat_jobs %}
{# Row 1: icon + name + status #}
{# Status dot #} {% if job.paused %} {% elif not job.last_success and job.run_count > 0 %} {% elif job.next_run == 'overdue' %} {% else %} {% endif %} {# Icon #}
{{ job.icon | safe }}

{{ job.name }}

{% if job.desc %}

{{ job.desc }}

{% endif %}
{# Status badge #}
{% if job.paused %} PAUSED {% elif not job.last_success and job.run_count > 0 %} FAIL {% else %} OK {% endif %}
{# Row 2: stats + next-run chip + last ran #}
{{ job.interval_fmt }} {{ job.run_count }} run{{ 's' if job.run_count != 1 }} {% if job.failure_count %} {{ job.failure_count }} fail{{ 's' if job.failure_count != 1 }} {% endif %} {% if job.last_run %} {{ job.last_run[:19] }} {% endif %} {% if not job.paused %} {% if job.next_run == 'overdue' %}overdue{% elif job.next_run %}{{ job.next_run }}{% endif %} {% endif %}
{# Row 3: last result collapsible #} {% if job.last_result %}
Last output
{{ job.last_result }}
{% endif %} {# Row 4: action buttons #}
{% if job.paused %} {% else %} {% endif %}
{% endfor %}
{% endfor %}
{# ── Custom Jobs ────────────────────────────────────────────────────── #}
Custom Jobs {{ custom_tasks|length }}
{% if not custom_tasks %}
No custom tasks yet. Click New Job to create your first automated job.
{% else %}
{% for task in custom_tasks %}
{# Row 1: name + enabled badge #}
{% if task.enabled %} {% else %} {% endif %}

{{ task.name }}

{{ task.instruction }}

{{ 'ON' if task.enabled else 'OFF' }}
{# Row 2: stats #}
{{ task.interval_fmt }} {{ task.run_count }} run{{ 's' if task.run_count != 1 }} {% if task.failure_count %} {{ task.failure_count }} fail{{ 's' if task.failure_count != 1 }} {% endif %} {% if task.last_run %} {{ task.last_run[:19] }} {% endif %} {% if task.last_success == false %} last run failed {% endif %}
{# Last result #} {% if task.last_result %}
Last output
{{ task.last_result[:600] }}
{% endif %} {# Actions #}
{% endfor %}
{% endif %}
{% endif %}{# end jobs #} {# ── Create Custom Task modal ────────────────────────────────────────── #} {% endblock %}