Skip to content

Edit and pause scheduled tasks; document missed runs - #474

Merged
Birfy merged 1 commit into
ThinkFlowLab:mainfrom
Birfy:feat/354-schedule-edit-pause
Oct 20, 2026
Merged

Birfy merged 1 commit into
ThinkFlowLab:mainfrom
Birfy:feat/354-schedule-edit-pause

Conversation

@Birfy

@Birfy Birfy commented Oct 20, 2026

Copy link
Copy Markdown
Collaborator

Fixes #354

First slice per the Owner decision of 2026-10-20 (option a). The rest of #354 (last run result, failed runs with retry, limits per #56) is filed as #473.

What

  • Edit: each scheduled task row (Settings → Scheduled tasks and a Bot's card) has a pencil Edit that turns the row into the existing task form, filled in, with Save changes. On the same chat it uses DSH's compare-and-update (id, next run and delivery records stay; timing is sent only when it changed). Moved to another Bot or group chat, or a finished one-time task: the new task is created first, then the old one deleted (same order as moveSchedules), so a failure keeps the old task. A cron rule the form cannot show is kept.
  • Pause / Resume: DSH has no pause, so Pause saves the task's record in FlyBot's state (pausedSchedules) before DSH deletes it (a failed delete rolls back); Resume creates it again on the Bot's current part before the paused copy goes. A paused row reads Paused; it can be edited (stays paused) or deleted. A one-time task whose time passed while paused waits for an edit.
  • Missed runs documented in docs/subsystems/core-host.md: after the app was closed a recurring task runs once, for its latest missed time, never once per missed time; a passed one-time task runs once on start. Tested against the pinned @deepseek-ai/dsh-schedule.
  • Authz: schedule-update needs the task's Session and its new target; pause/resume need the Session. The edit text gets the same chip check as schedule-create.

Test

  • ARCH_DOCS_BASE=origin/main TZ=UTC npm run verify: pass (core 1038, social 291, tree 80, timeline 80, scripts 88, interop 37, live-e2e 16; 0 failures).
  • New: core/test/schedules.test.js (edit in place, edit to another chat with failure kept, pause/resume with failures, paused delete and passed one-time, missed-run contract), core/test/schedules-client.test.js (row buttons, prefilled form, form start), core/test/authz.test.js (Proactive reminders 2/3: scheduled tasks and recurring summaries #354 endpoints).
  • Not run: live DSH app / Mac instances.

Risk tier: T2 (estimate; the controller sets the label)

Settings > Scheduled tasks and a Bot's card get Edit (the task form, filled in)
and Pause/Resume. Edit uses DSH's compare-and-update on the same Session and
create-then-delete when the task moves to another chat. DSH has no pause, so a
paused task's record is kept in FlyBot's state and created again on Resume.
docs/subsystems/core-host.md says what DSH does with runs missed while the app
was closed (one run for the latest missed time), with a test.
@Birfy Birfy added agent-pr Pull request opened by an agent enhancement New feature or request labels Oct 20, 2026
@Birfy Birfy self-assigned this Oct 20, 2026
@Birfy Birfy added the area:automation Scheduled tasks and automation label Oct 20, 2026
@Birfy

Birfy commented Oct 20, 2026

Copy link
Copy Markdown
Collaborator Author

Self-review: PASS
Tip SHA: 1c5228e
Ran:

  • ARCH_DOCS_BASE=origin/main TZ=UTC npm run verify (incl. plugin lint, arch-docs OK 21 files): pass, 0 failures (core 1038, social 291, tree 80, timeline 80, scripts 88, interop 37, live-e2e 16)
  • node scripts/ds-bot-patches.mjs check: ok (core = ds-bot + patches); node core/scripts/build-client.mjs --check: ok
  • node .github/scripts/changelog.mjs check: ok
  • CI at the tip: tests-ok, test, plugins (social/tree/timeline), package all pass
  • node .github/scripts/risk-gate.mjs --pr 474: T3 (authz.js, channel.js)
  • Diff reviewed against the owner design rules: scope is the Owner-decision slice only (edit, pause/resume, documented missed runs); English UI with zh strings; one-word actions; no new menus or sections; authz keeps the owner-only rule (edit needs the task's Session and the new target; pause/resume need the Session); a failed edit/pause/resume never loses a task
    Not run:
  • Live DSH app / the owner's Mac instances (not touched)
  • Smoke bench (dev/bench.sh smoke)

@Birfy Birfy added the awaiting-approval PR is green and waits for the maintainer's approval (T2/T3) or a review PASS at its tip label Oct 20, 2026
@github-actions github-actions Bot added the risk:T3 Risk tier T3 (needs a human approval), set by the controller from the diff label Oct 20, 2026
@Birfy
Birfy added this pull request to the merge queue Oct 20, 2026
Merged via the queue into ThinkFlowLab:main with commit 465357e Oct 20, 2026
8 checks passed
@Birfy
Birfy deleted the feat/354-schedule-edit-pause branch October 20, 2026 01:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent-pr Pull request opened by an agent area:automation Scheduled tasks and automation awaiting-approval PR is green and waits for the maintainer's approval (T2/T3) or a review PASS at its tip enhancement New feature or request risk:T3 Risk tier T3 (needs a human approval), set by the controller from the diff

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Proactive reminders 2/3: scheduled tasks and recurring summaries

1 participant