generate_bot_message ref
Violation of Single Responsibility: one 200 line method doing everything from lookup to templating to raw LLM calls to AST-style post processing.
Branch explosion: four or five nested if/elif blocks on config flags makes the control flow almost unreadable.
Hard to extend/test: want to change how passthrough works? we have to wade through static lookup and default generation code first. unittesting a single branch means mocking out five others.