This issue is AI generated.
Problem
flutter_app/lib/main_controller.dart is approximately 7000+ lines and contains nearly all app state, all Socket.IO event handlers, all backend API call wrappers, and significant business logic. GUIDELINES.md states:
"flutter_app/lib/main_controller.dart is the single root ChangeNotifier. Do not introduce competing global state objects."
"Feature logic goes in lib/src/<feature>_bridge.dart or lib/src/<feature>_service.dart. Widgets are thin — no business logic in widget files."
The controller violates the second principle entirely. The consequence: every feature change requires reading the entire file, merge conflicts are frequent, and the controller cannot be unit tested in isolation.
Required change
Extract feature domains into dedicated bridge/service classes following the established _io / _web / _stub pattern:
lib/src/agent_run_bridge.dart — run submission, steerable run state, tool events
lib/src/approval_bridge.dart — pending approval queue, approval resolution
lib/src/voice_bridge.dart — live voice session management
lib/src/recording_bridge_service.dart — recording session lifecycle (expand existing stub)
lib/src/memory_bridge.dart — memory read/write, retrieval inspector data
NeoAgentController becomes a thin coordinator that instantiates and delegates to these bridges and exposes their state to the widget tree.
Acceptance criteria
main_controller.dart is under 800 lines after extraction.
- Each bridge/service file is independently testable.
- All existing Flutter tests pass.
- No new global state objects are introduced; bridges are owned by the controller.
This issue is AI generated.
Problem
flutter_app/lib/main_controller.dartis approximately 7000+ lines and contains nearly all app state, all Socket.IO event handlers, all backend API call wrappers, and significant business logic. GUIDELINES.md states:The controller violates the second principle entirely. The consequence: every feature change requires reading the entire file, merge conflicts are frequent, and the controller cannot be unit tested in isolation.
Required change
Extract feature domains into dedicated bridge/service classes following the established
_io/_web/_stubpattern:lib/src/agent_run_bridge.dart— run submission, steerable run state, tool eventslib/src/approval_bridge.dart— pending approval queue, approval resolutionlib/src/voice_bridge.dart— live voice session managementlib/src/recording_bridge_service.dart— recording session lifecycle (expand existing stub)lib/src/memory_bridge.dart— memory read/write, retrieval inspector dataNeoAgentControllerbecomes a thin coordinator that instantiates and delegates to these bridges and exposes their state to the widget tree.Acceptance criteria
main_controller.dartis under 800 lines after extraction.