3.5 KiB
Sprint 003 — Agent Worker + Daily Telegram Digest
Depends on: Sprint 002 (FTS, duration, view count, pagination) Duration: ~8h total Goal: Make the agent queue functional (LLM processing), and deliver a daily Telegram digest of new YouTube summaries.
T3.1 — Implement agent_worker LLM processing
-
Files:
backend/agent_worker.py,backend/main.py -
Done means:
agent_worker.pyprocesses items fromagent_queuewith status=pending:- Calls local LLM (via
QWEN_BASE_URLenv) or DeepSeek API to process the queued note/prompt. - Stores result in
agent_queue.resultcolumn. - Updates status:
pending→processing→done(orerror). - Runs as background loop every 30s.
- Calls local LLM (via
-
Verify by:
- Add item to agent queue via frontend "Save to Agent".
- Watch status change to
processingthendonein queue tab. resultfield populated with LLM response.
-
Risk: LLM endpoint may be unreachable from NAS. Use
AGENT_BASE_URLenv var with fallback to DeepSeek API. -
T3.1 — Agent worker LLM processing
T3.2 — Daily Telegram digest via cron
-
Files: New cron job in Hermes (not in repo — Hermes-managed)
-
Done means: Every morning at 8:00 AM CST (00:00 UTC), Hermes:
- Calls
GET /api/videos?status=pending&limit=20on t-youtube backend. - Groups by channel.
- Formats and sends a Telegram digest message: channel name, video title, summary snippet.
- Marks videos as
readafter sending (optional, or just inform).
- Calls
-
Verify by:
- Trigger cron manually → Telegram message received.
- Message shows channel groupings, titles, and summaries.
-
Risk: t-youtube API behind Authelia — cron needs API token, not SSO. Use
API_TOKENenv var. -
T3.2 — Daily Telegram digest cron
T3.3 — Duration + view count display in frontend
-
Files:
frontend/src/routes/YoutubeDashboard.svelte -
Done means: Video list items show duration (formatted as
MM:SSorH:MM:SS) and view count (formatted as1.2M,45K) in the sidebar list item. -
Verify by:
- Open dashboard → sidebar shows duration + view count for videos where populated.
- Videos with
duration=nullshow nothing (no broken display).
-
Risk: Most existing videos don't have duration yet (only newly synced ones do). Display only if non-null.
-
T3.3 — Duration + views display in video list
T3.4 — Search UX polish: debounce + loading state
-
Files:
frontend/src/routes/YoutubeDashboard.svelte -
Done means:
- Search input debounced 300ms (no API call on every keystroke).
- Loading spinner shows while fetching search results.
- "No results" state when FTS returns empty.
-
Verify by:
- Type quickly → only one API call fires (after 300ms pause).
- Loading state visible while waiting.
- Type nonsense → "No results" shows cleanly.
-
T3.4 — Search debounce + loading state
T3.5 — Update active.md symlink to Sprint 003
-
File:
docs/specs/active.md -
Done means: Symlink points to
sprint-003-agent-digest.md. -
Verify by:
ls -la docs/specs/active.md→ points to sprint-003. -
T3.5 — Update active.md symlink
Exit criteria
- Agent queue processes items via LLM — status changes pending → done, result populated
- Daily Telegram digest cron fires at 8 AM CST with grouped summaries
- Duration + view count shown in video list (non-null only)
- Search debounced, has loading state and empty state
- All 23+ backend tests pass
- Frontend builds cleanly