[routes] task_routes.py (1000 lines), shell_routes.py (936 lines), history_routes.py (619 lines), research_routes.py (611 lines), mcp_routes.py (579 lines) all exceed AGENTS.md ~400 line limit #779

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

Problem

Multiple route files exceed the ~400 line guideline:

File Lines Functions
routes/task_routes.py 1000 31
routes/shell_routes.py 936 28
routes/history_routes.py 619 13
routes/research_routes.py 611 23
routes/mcp_routes.py 579 16

Specific concerns

  • shell_routes.py mixes PTY streaming, tmux session management, Windows detached mode, SSH remote execution, and package management — 5 distinct concerns in one file
  • task_routes.py mixes task CRUD, task scheduling UI, scheduled task management, and cross-imports from routes/prefs_routes.py and routes/email_helpers
  • research_routes.py imports services/research/ but the deep research flow has inline logic

AGENTS.md violation

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

Cross-route coupling

  • routes/history_routes.py imports from routes.session_routes import _verify_session_owner — private function across routes
  • routes/task_routes.py imports from routes.prefs_routes import _load_for_user, _save_for_user
  • routes/cookbook_routes.py imports from routes.shell_routes import TMUX_LOG_DIR
  • routes/skills_routes.py has from routes.prefs_routes import _load_for_user
## Problem Multiple route files exceed the ~400 line guideline: | File | Lines | Functions | |------|-------|------------| | `routes/task_routes.py` | 1000 | 31 | | `routes/shell_routes.py` | 936 | 28 | | `routes/history_routes.py` | 619 | 13 | | `routes/research_routes.py` | 611 | 23 | | `routes/mcp_routes.py` | 579 | 16 | ## Specific concerns - `shell_routes.py` mixes PTY streaming, tmux session management, Windows detached mode, SSH remote execution, and package management — 5 distinct concerns in one file - `task_routes.py` mixes task CRUD, task scheduling UI, scheduled task management, and cross-imports from `routes/prefs_routes.py` and `routes/email_helpers` - `research_routes.py` imports `services/research/` but the deep research flow has inline logic ## AGENTS.md violation > Split files that exceed ~400 lines or contain multiple concerns. ## Cross-route coupling - `routes/history_routes.py` imports `from routes.session_routes import _verify_session_owner` — private function across routes - `routes/task_routes.py` imports `from routes.prefs_routes import _load_for_user, _save_for_user` - `routes/cookbook_routes.py` imports `from routes.shell_routes import TMUX_LOG_DIR` - `routes/skills_routes.py` has `from routes.prefs_routes import _load_for_user`
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#779
No description provided.