MEDIUM: Remove dead/vestigial code modules #36
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
Several modules contain dead code that adds maintenance burden, confuses new readers, and clutters the codebase:
1. bot/command_router.py (~30 lines) — Vestigial
Its only function returns mood state. ALL actual command routing happens in bot.py's on_message() handler. This module serves no purpose and is misleading (the name suggests it handles routing but it does not).
2. bot/utils/gpu_router.py (~180 lines) — Unused
Provides sophisticated GPU load-balancing utilities, but nothing in the codebase calls them. Actual GPU routing uses simpler inline functions in llm.py that read globals.PREFER_AMD_GPU directly. The entire module appears to be dead code.
3. bot/utils/context_manager.py — Dead response_type branching
Accepts a response_type parameter (e.g., 'dm_response', 'voice_response', 'autonomous') but returns IDENTICAL context for every type. The branching code is dead — every branch does the same thing. Either remove the parameter and simplify, or implement the intended differentiation.
4. bot/commands/actions.py (75 lines) — Deprecated but still called
All functions (set_mood, reset_mood, force_sleep, wake_up) log deprecation warnings, but are still actively imported and called by the autonomous system (bot/utils/autonomous.py). Either:
Proposed Solution
Impact
Verification Steps