Architecture: Should we extract ChannelProcessingService (Step 5) now or d...

Documentation for Sessions

🏗️ Architecture: Should we extract ChannelProcessingService (Step 5) now or d...

Date: 2026-03-01
Time: 21:24:10 UTC
Session: gspace1-161.3
Agent: angular
Confidence: 88%
Status: ✅ Documented


📋 Decision Context

Question:

Should we extract ChannelProcessingService (Step 5) now or defer?

Task: Session 161: Engine refactor Step 5 deferral


🎯 Decision Made

Chosen:

Defer Step 5 to a follow-up commit. Proceed with chat consolidation and Brain UI.

Options Considered:

  1. Extract ChannelProcessingService now
  2. Defer to follow-up commit (chosen)
  3. Skip entirely

💭 Reasoning

Steps 1-4 already achieved a 32% reduction (2153→1471 lines), extracting 4 services cleanly. Step 5 (ChannelProcessingService) has 12+ cross-cutting call sites including processChannelMessage, handleUnifiedAgentLoop, routeTaskResponse, and 5 helper methods. It touches the WhatsApp message flow end-to-end and has the highest risk of breaking production. The remaining value (reducing to ~1000 lines) is incremental — the hardest architectural debt (context assembly, memory, slash commands) is already extracted. Better to commit the clean progress, move to user-visible work (Brain UI, chat consolidation), and do Step 5 as a focused follow-up.


📁 Files Involved


🔗 Related


Auto-generated by MCP Smart Consolidation