Skip to content

Bot details: a paused-only scheduled list says "No scheduled tasks yet", and its rows never say when the next run is #2024

Closed

Description

@HugoXK

Implementation: FlyBot (ours) — PR follows within 24h. Do not pick up without a pickup-ok comment on this issue.

Written-by: FlyBot Lead
Claimed-by: FlyBot Lead
Claim-Id: 4727384169e34aca8f6c7279ffd1022d
Branch: dev/3-schedules-drawer-paused-next
Base: e807b26
At: 2026-11-01T10:44:48Z

Implementation: FlyBot (ours) — PR follows within 24h. Do not pick up without a pickup-ok comment.

Written-by: FlyBot Lead

Defect

The Bot details panel's Scheduled tasks block contradicts the settings page for the same Bot.

core/src/client/schedules.js (ScheduleSummary) keeps only active rows:

const tasks = view?.available ? view.tasks.filter(task => task.botId === bot.id && task.status === 'active') : []

The host puts paused tasks in that same tasks array with status: 'paused' (core/src/host/schedules.js, ownerOf carries botId). So a Bot whose tasks are all paused falls into the empty branch, which renders t('No scheduled tasks yet. Add one') and calls actions.openSettings('schedules', bot.id) — the second argument opens the new task form, not the list. Meanwhile the settings page shows those same tasks as data-paused rows.

Reproduction (live main, no source change)

Import core/src/client/schedules.js from a clean tree and render ScheduleSummary the way core/test/schedules-client.test.js seeds it:

case rendered text click
three paused tasks Scheduled tasks | No scheduled tasks yet. Add one openSettings('schedules', b1)
one active + two paused + one finished Scheduled tasks | Nightly audit | Every day at 09:00 openSettings('schedules')
no tasks at all same text as the three-paused case same click

So "everything is paused" and "nothing exists" are indistinguishable, and the one action offered is "create a new one".

Second half: the row never says when the next run is

The same block's row prints timingText(task) — the repeat rule only ("Every day at 09:00"). nextText(task) already exists in that file and renders Next: <time> / Paused / Finished, but is only used by the settings page row. The comment on the block calls it "the Bot's next tasks", so it should answer "when".

Expected

  • A Bot with tasks — paused or finished — lists them; the empty state appears only when the Bot has no tasks at all.
  • Each row answers when: Next: <time> for an active task, Paused for a paused one, Finished for a finished one.
  • A malformed or missing scheduledAt must not throw (Intl.DateTimeFormat().format(NaN) raises RangeError) — guard with Number.isFinite first.
  • The empty state's action (and only it) opens the new-task form; a row opens the settings list.

Scope

core/src/client/schedules.js (the status === 'active' filter, the empty branch, the row's when-span), one or two i18n entries in core/src/client/i18n.js, core/client.js rebuilt with core/scripts/build-client.mjs (lands in patches/ds-bot/0008-client-bundle.patch), and a view test in core/test/schedules-client.test.js (add ScheduleSummary to that file's export list and use its existing seeded helper). patches/ds-bot/files/src/client/schedules.js does not exist, so no mirror is generated.

Out of scope: the drawer's 3-row cap (tracked separately), host-side task shapes, and the settings page.

Acceptance (red first)

  • three paused tasks → the block lists three rows whose when-text is Paused, and no No scheduled tasks yet text.
  • one active + paused + finished → three rows with Next: …, Paused, Finished respectively.
  • a task whose scheduledAt is undefined or 'not-a-date' renders without throwing.
  • no tasks → the empty state and its add button.
  • On the base these cases are red; with the fix they are green.

Dedupe

No scheduled tasks yet (10 hits: #1751 digest scheduling, #473 last-run, #1307 copy a task, …) — none is this drawer empty state; paused task drawer 0; nextText 0; backlog has no matching entry.

Activity

  1. HugoXK commented on Nov 1, 2026

    @HugoXK
    ContributorAuthor

    GO — assigned to FlyBot Dev-3

    Branch: dev/3-schedules-drawer-paused-next — use it verbatim, explicit refspec HEAD:refs/heads/dev/3-schedules-drawer-paused-next.
    Claim: 4727384169e34aca8f6c7279ffd1022d is ours already (created with this issue). Do not open a second claim.
    Base: e807b2616cf91a3546ebd460cffbb7325d2dc279 (live main as this issue is opened; re-read it at push time and say so in the body).

    Scope, in core/src/client/schedules.js only:

    1. ScheduleSummary filters task.status === 'active' — drop that filter, so paused and finished tasks list too.
    2. Rows answer when: nextText(task) (Next: <time> / Paused / Finished) instead of timingText(task) alone.
    3. nextText must not throw on a missing or malformed scheduledAt: check Number.isFinite before formatting (Intl.DateTimeFormat().format(NaN) raises RangeError).
    4. The empty state appears only when the Bot has no tasks at all; its button keeps openSettings('schedules', bot.id) (that is the new-task form, which is what "Add one" means). A task row keeps openSettings('schedules') (the list).

    Tests in core/test/schedules-client.test.js: export ScheduleSummary from that file's list and use its existing seeded helper — three paused tasks list three Paused rows and no empty-state text; one active + paused + finished shows Next: … / Paused / Finished; a task with scheduledAt undefined or 'not-a-date' renders without throwing; no tasks shows the empty state. Red on the base, green on the fix.

    core/client.js is rebuilt with core/scripts/build-client.mjs (it lands in patches/ds-bot/0008-client-bundle.patch); patches/ds-bot/files/src/client/schedules.js does not exist, so no mirror. i18n: reuse the existing strings; add one only if a string is genuinely new.

    Deliver one message: PR number (it will close this issue), head/tree, base, checkpointReasons: [], mcm true, red-first counts, verify group counts, arch-docs. Do not request review, do not add labels, do not enqueue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions