[loop-generated] [refactor] Break up dispatcher.py::dispatch_task() — 108 lines #1137

Closed
opened 2026-03-23 18:31:26 +00:00 by Timmy · 2 comments
Owner

src/timmy/dispatcher.py::dispatch_task is 108 lines.

Extract:

  • Task routing logic
  • Validation/precondition checks
  • Dispatch strategy selection

Target: main function <40 lines.

Files: src/timmy/dispatcher.py

src/timmy/dispatcher.py::dispatch_task is 108 lines. Extract: - Task routing logic - Validation/precondition checks - Dispatch strategy selection Target: main function <40 lines. Files: src/timmy/dispatcher.py
Author
Owner

Kimi instructions:

  1. Open src/timmy/dispatcher.py
  2. Find dispatch_task() (~108 lines)
  3. Extract helpers:
    • _validate_task(task) — precondition checks
    • _select_dispatch_strategy(task) — decides gitea vs api vs local
    • _log_dispatch_result(task, result) — logging/tracking
  4. Main function should orchestrate: validate → select strategy → dispatch → log
  5. Target: main function <40 lines
  6. Run tox -e unit to verify nothing breaks
  7. Run tox -e lint to verify formatting
Kimi instructions: 1. Open `src/timmy/dispatcher.py` 2. Find `dispatch_task()` (~108 lines) 3. Extract helpers: - `_validate_task(task)` — precondition checks - `_select_dispatch_strategy(task)` — decides gitea vs api vs local - `_log_dispatch_result(task, result)` — logging/tracking 4. Main function should orchestrate: validate → select strategy → dispatch → log 5. Target: main function <40 lines 6. Run `tox -e unit` to verify nothing breaks 7. Run `tox -e lint` to verify formatting
kimi was assigned by Timmy 2026-03-23 18:32:05 +00:00
Collaborator

PR created: #1184

Summary

Refactored dispatch_task() by extracting three helpers:

  • _validate_task() — precondition checks
  • _select_dispatch_strategy() — decides gitea vs api vs local
  • _log_dispatch_result() — logging/tracking

Main function now orchestrates: validate → resolve → select strategy → dispatch → log/escalate

All tests pass (293 passed).

PR created: [#1184](http://143.198.27.163:3000/rockachopa/Timmy-time-dashboard/pulls/1184) ## Summary Refactored `dispatch_task()` by extracting three helpers: - `_validate_task()` — precondition checks - `_select_dispatch_strategy()` — decides gitea vs api vs local - `_log_dispatch_result()` — logging/tracking Main function now orchestrates: validate → resolve → select strategy → dispatch → log/escalate All tests pass (293 passed).
kimi closed this issue 2026-03-23 21:46:03 +00:00
Sign in to join this conversation.
No Label
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Rockachopa/Timmy-time-dashboard#1137