[loop-generated] [refactor] Break up thinking.py::_maybe_file_issues() — 99 lines #1170

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

Problem

src/timmy/thinking.py::_maybe_file_issues() is 99 lines.

Acceptance Criteria

  • Extract into smaller helpers
  • Keep main function under 40 lines
  • All existing tests pass

Files

  • src/timmy/thinking.py
## Problem `src/timmy/thinking.py::_maybe_file_issues()` is 99 lines. ## Acceptance Criteria - Extract into smaller helpers - Keep main function under 40 lines - All existing tests pass ## Files - `src/timmy/thinking.py`
claude was assigned by Rockachopa 2026-03-23 20:33:17 +00:00
Collaborator

PR created: #1173

Refactored _maybe_file_issues() from 99 lines down to 33 by extracting four focused helpers:

  • _get_recent_thoughts_for_issues(): guard/pre-condition checks
  • _build_issue_classify_prompt(): LLM prompt construction (static)
  • _parse_issue_items(): markdown fence + JSON parsing (static)
  • _file_single_issue(): per-item validation and Gitea creation

All 175 unit tests pass.

PR created: #1173 Refactored `_maybe_file_issues()` from 99 lines down to 33 by extracting four focused helpers: - `_get_recent_thoughts_for_issues()`: guard/pre-condition checks - `_build_issue_classify_prompt()`: LLM prompt construction (static) - `_parse_issue_items()`: markdown fence + JSON parsing (static) - `_file_single_issue()`: per-item validation and Gitea creation All 175 unit tests pass.
Author
Owner

Kimi Instructions

Break up src/timmy/thinking.py::_maybe_file_issues() — currently 99 lines.

Files to modify

  • src/timmy/thinking.py

What to do

  • Extract _maybe_file_issues() into smaller helper functions
  • Each helper handles one logical step (e.g., checking if issue exists, building issue body, filing to Gitea)
  • Keep the public API identical
  • Target: no function over 30 lines

How to verify

tox -e unit

All existing tests must pass. No behavior changes.

## Kimi Instructions Break up `src/timmy/thinking.py::_maybe_file_issues()` — currently 99 lines. ### Files to modify - `src/timmy/thinking.py` ### What to do - Extract `_maybe_file_issues()` into smaller helper functions - Each helper handles one logical step (e.g., checking if issue exists, building issue body, filing to Gitea) - Keep the public API identical - Target: no function over 30 lines ### How to verify ``` tox -e unit ``` All existing tests must pass. No behavior changes.
claude was unassigned by Timmy 2026-03-23 21:01:27 +00:00
kimi was assigned by Timmy 2026-03-23 21:01:27 +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#1170