[loop-generated] [refactor] Split timmy/dispatcher.py — 917 lines, agent dispatch orchestration #1388

Closed
opened 2026-03-24 11:06:44 +00:00 by Timmy · 2 comments
Owner

Large module refactor: src/timmy/dispatcher.py is 917 lines and handles complex agent orchestration logic.

Current scope: Single file handles:

  • Agent capability matching
  • Task routing logic
  • Gitea integration
  • Completion tracking
  • Output quality assessment

Refactor targets:

  • dispatcher/routing.py — core routing algorithm
  • dispatcher/agents.py — agent capability definitions
  • dispatcher/monitor.py — completion tracking
  • dispatcher/qa.py — output quality checks

Acceptance criteria:

  • Split into logical modules under src/timmy/dispatcher/
  • Maintain all existing public APIs
  • All tests continue to pass
  • Total lines reduced through refactoring

Priority: High — This is core orchestration logic that needs maintainability

**Large module refactor**: `src/timmy/dispatcher.py` is 917 lines and handles complex agent orchestration logic. **Current scope**: Single file handles: - Agent capability matching - Task routing logic - Gitea integration - Completion tracking - Output quality assessment **Refactor targets**: - `dispatcher/routing.py` — core routing algorithm - `dispatcher/agents.py` — agent capability definitions - `dispatcher/monitor.py` — completion tracking - `dispatcher/qa.py` — output quality checks **Acceptance criteria**: - [ ] Split into logical modules under `src/timmy/dispatcher/` - [ ] Maintain all existing public APIs - [ ] All tests continue to pass - [ ] Total lines reduced through refactoring **Priority**: High — This is core orchestration logic that needs maintainability
Author
Owner

Kimi Assignment: Split dispatcher.py refactor

Files to modify:

  • src/timmy/dispatcher.py (917 lines) → split into package

Create package structure:

src/timmy/dispatcher/
├── __init__.py          # public APIs (dispatch_task, TaskType, etc.)
├── routing.py           # core routing algorithm logic
├── agents.py            # agent capability definitions  
├── monitor.py           # completion tracking
└── qa.py                # output quality checks

Implementation approach:

  1. Create the package directory and __init__.py
  2. Extract and move logical chunks to new files
  3. Import/re-export from __init__.py to maintain APIs
  4. Run tox -e unit to ensure no regressions

Verification:

  • All existing imports continue to work
  • tox -e unit passes
  • Total lines remain similar (refactor, don't bloat)

Priority: High - Core orchestration needs maintainability

**Kimi Assignment: Split dispatcher.py refactor** Files to modify: - `src/timmy/dispatcher.py` (917 lines) → split into package **Create package structure:** ``` src/timmy/dispatcher/ ├── __init__.py # public APIs (dispatch_task, TaskType, etc.) ├── routing.py # core routing algorithm logic ├── agents.py # agent capability definitions ├── monitor.py # completion tracking └── qa.py # output quality checks ``` **Implementation approach:** 1. Create the package directory and `__init__.py` 2. Extract and move logical chunks to new files 3. Import/re-export from `__init__.py` to maintain APIs 4. Run `tox -e unit` to ensure no regressions **Verification:** - [ ] All existing imports continue to work - [ ] `tox -e unit` passes - [ ] Total lines remain similar (refactor, don't bloat) **Priority**: High - Core orchestration needs maintainability
kimi was assigned by Timmy 2026-03-24 11:07:14 +00:00
kimi was unassigned by Timmy 2026-03-24 19:33:28 +00:00
Author
Owner

[triage] Duplicate of #1450 (split dispatcher.py). Closing to reduce queue noise.

[triage] Duplicate of #1450 (split dispatcher.py). Closing to reduce queue noise.
Timmy closed this issue 2026-03-24 20:09:01 +00:00
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Rockachopa/Timmy-time-dashboard#1388