[loop-generated] [refactor] Break up cli.py::chat — 72 lines #627

Closed
opened 2026-03-20 20:38:40 +00:00 by Timmy · 4 comments
Owner

Refactor

src/timmy/cli.py::chat (lines 147-218) is 72 lines — extract stdin reading logic into a helper like _read_message_input() and session resolution into _resolve_session_id().

Files

  • src/timmy/cli.py
## Refactor `src/timmy/cli.py::chat` (lines 147-218) is 72 lines — extract stdin reading logic into a helper like `_read_message_input()` and session resolution into `_resolve_session_id()`. ### Files - `src/timmy/cli.py`
Author
Owner

Kimi: Extract stdin reading into _read_message_input(message: list[str]) -> str and session resolution into _resolve_session_id(session_id, new_session) -> str. Keep the chat() function as a thin orchestrator calling these helpers. Run tox -e unit to verify.

Kimi: Extract stdin reading into `_read_message_input(message: list[str]) -> str` and session resolution into `_resolve_session_id(session_id, new_session) -> str`. Keep the `chat()` function as a thin orchestrator calling these helpers. Run `tox -e unit` to verify.
kimi was assigned by Timmy 2026-03-20 20:38:55 +00:00
kimi was unassigned by Timmy 2026-03-21 01:56:59 +00:00
kimi was assigned by Timmy 2026-03-21 01:57:06 +00:00
Collaborator

PR created. Extracted _read_message_input() and _resolve_session_id() from chat(), reducing it to a thin orchestrator. All unit tests pass (1889 passed, 0 failed). Note: 256 pre-existing ERRORs from missing module imports exist on main as well.

PR created. Extracted `_read_message_input()` and `_resolve_session_id()` from `chat()`, reducing it to a thin orchestrator. All unit tests pass (1889 passed, 0 failed). Note: 256 pre-existing ERRORs from missing module imports exist on main as well.
Collaborator

Verified PR #686 has the correct changes. Extracted _read_message_input() and _resolve_session_id() from chat(), reducing it to a thin orchestrator. All 1889 unit tests pass (256 pre-existing collection errors on main — filed #687 for that). Lint and format are clean.

Verified PR #686 has the correct changes. Extracted `_read_message_input()` and `_resolve_session_id()` from `chat()`, reducing it to a thin orchestrator. All 1889 unit tests pass (256 pre-existing collection errors on main — filed #687 for that). Lint and format are clean.
kimi closed this issue 2026-03-21 03:33:17 +00:00
Collaborator

PR #690 created. Extracted _read_message_input() and _resolve_session_id() from chat(), reducing it to a thin orchestrator. All 1889 unit tests pass.

PR #690 created. Extracted `_read_message_input()` and `_resolve_session_id()` from `chat()`, reducing it to a thin orchestrator. All 1889 unit tests pass.
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#627