feat(scheduler): add scheduled jobs with channel-aware delivery

Introduce persisted cron/interval jobs, gateway scheduler loop, worker turns,
and admin CRUD/edit UI. Route proactive reminders via the originating chat
channel (WhatsApp vs WeChat), harden Weixin outbound with durable queue and
PG-compatible polling, and fix chat UI to show each scheduled reminder separately.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
oliver 2026-06-26 15:56:10 +08:00
parent 5336f8835f
commit 47813f6a94
45 changed files with 4956 additions and 43 deletions

View file

@ -0,0 +1,20 @@
from __future__ import annotations
import unittest
from runtime.application.gateway.inbound_service import _parse_schedule_duration_seconds
class ScheduleDurationParseTests(unittest.TestCase):
def test_minutes(self) -> None:
self.assertEqual(_parse_schedule_duration_seconds("5分钟"), 300)
def test_hours(self) -> None:
self.assertEqual(_parse_schedule_duration_seconds("1小时"), 3600)
def test_seconds(self) -> None:
self.assertEqual(_parse_schedule_duration_seconds("120秒"), 120)
if __name__ == "__main__":
unittest.main()