[infrastructure] task_scheduler.py at 2174 lines massively exceeds AGENTS.md ~400 line limit #774

Closed
opened 2026-06-03 00:28:40 +02:00 by sleepy · 0 comments
Owner

Problem

src/task_scheduler.py is 2174 lines with a single TaskScheduler class containing 40+ methods spanning:

  • TTL cache / singleflight logic
  • Schedule computation and timezone handling
  • Task execution engine with model slot management
  • Notification system
  • Email delivery
  • MCP tool execution
  • Agent loop execution
  • Research task execution
  • Task chaining with cycle detection
  • Miniflux RSS integration
  • Default task resolution
  • Health check / ping loops

Plus ~15 standalone helper functions.

AGENTS.md violation

Split files that exceed ~400 lines or contain multiple concerns.

This is the largest single file in the codebase and contains at least 8 distinct concerns.

Suggested split

  • scheduler/cache.py — shared TTL cache
  • scheduler/timing.py — schedule computation, timezone resolution
  • scheduler/executor.py — core task execution loop
  • scheduler/notifications.py — notification management
  • scheduler/delivery.py — email, MCP, session delivery
  • scheduler/actions/ — individual action handlers (LLM, check-in, research, agent loop)
  • scheduler/defaults.py — default task resolution
  • scheduler/README.md
## Problem `src/task_scheduler.py` is 2174 lines with a single `TaskScheduler` class containing 40+ methods spanning: - TTL cache / singleflight logic - Schedule computation and timezone handling - Task execution engine with model slot management - Notification system - Email delivery - MCP tool execution - Agent loop execution - Research task execution - Task chaining with cycle detection - Miniflux RSS integration - Default task resolution - Health check / ping loops Plus ~15 standalone helper functions. ## AGENTS.md violation > Split files that exceed ~400 lines or contain multiple concerns. This is the largest single file in the codebase and contains at least 8 distinct concerns. ## Suggested split - `scheduler/cache.py` — shared TTL cache - `scheduler/timing.py` — schedule computation, timezone resolution - `scheduler/executor.py` — core task execution loop - `scheduler/notifications.py` — notification management - `scheduler/delivery.py` — email, MCP, session delivery - `scheduler/actions/` — individual action handlers (LLM, check-in, research, agent loop) - `scheduler/defaults.py` — default task resolution - `scheduler/README.md`
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
sleepy/odysseus#774
No description provided.