Refactor copilot.service.ts - split into focused sub-services #14

Closed
opened 2026-02-08 06:44:20 -08:00 by kyle · 1 comment
Owner

Context: copilot.service.ts is 2,758 lines - a monolithic service handling scheduling, reporting, utilization, fleet management, and more. This makes it hard to maintain and test.

File: backend/src/copilot/copilot.service.ts

Suggested fix:

  • Split into focused services:
    • CopilotCoreService - message handling, tool dispatch, system prompt
    • CopilotScheduleService - schedule-related tool implementations
    • CopilotReportService - reporting and analytics tools
    • CopilotFleetService - vehicle/driver management tools
  • Keep the main service as a thin orchestrator that delegates to sub-services

Effort: Medium

**Context:** `copilot.service.ts` is 2,758 lines - a monolithic service handling scheduling, reporting, utilization, fleet management, and more. This makes it hard to maintain and test. **File:** `backend/src/copilot/copilot.service.ts` **Suggested fix:** - Split into focused services: - `CopilotCoreService` - message handling, tool dispatch, system prompt - `CopilotScheduleService` - schedule-related tool implementations - `CopilotReportService` - reporting and analytics tools - `CopilotFleetService` - vehicle/driver management tools - Keep the main service as a thin orchestrator that delegates to sub-services **Effort:** Medium
Author
Owner

Split copilot.service.ts (2758 lines) into 5 focused files: copilot.service.ts (orchestrator), copilot-schedule.service.ts, copilot-reports.service.ts, copilot-fleet.service.ts, copilot-vip.service.ts.

Split copilot.service.ts (2758 lines) into 5 focused files: copilot.service.ts (orchestrator), copilot-schedule.service.ts, copilot-reports.service.ts, copilot-fleet.service.ts, copilot-vip.service.ts.
kyle closed this issue 2026-02-08 07:34:35 -08:00
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: kyle/vip-coordinator#14