[loop-generated] [refactor] Break up create_timmy() — 131 lines in agent.py #512

Closed
opened 2026-03-19 23:19:59 +00:00 by Timmy · 0 comments
Owner

Problem

create_timmy() in src/timmy/agent.py is 131 lines — a monolith that handles backend resolution, model pulling, agent construction, and tool registration.

Suggested refactor

  1. Extract _resolve_backend() — the backend selection logic (~30 lines)
  2. Extract _build_tools() — tool list assembly (~20 lines)
  3. Keep create_timmy() as a slim orchestrator calling the helpers

Files

  • src/timmy/agent.py

Acceptance criteria

  • All 2096 tests still pass
  • create_timmy() is under 60 lines
  • Each extracted helper is independently testable
## Problem `create_timmy()` in `src/timmy/agent.py` is 131 lines — a monolith that handles backend resolution, model pulling, agent construction, and tool registration. ## Suggested refactor 1. Extract `_resolve_backend()` — the backend selection logic (~30 lines) 2. Extract `_build_tools()` — tool list assembly (~20 lines) 3. Keep `create_timmy()` as a slim orchestrator calling the helpers ## Files - `src/timmy/agent.py` ## Acceptance criteria - All 2096 tests still pass - `create_timmy()` is under 60 lines - Each extracted helper is independently testable
Timmy closed this issue 2026-03-19 23:52: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#512