[loop-generated] [test] Add unit tests for agentic_loop.py #421

Closed
opened 2026-03-19 14:05:15 +00:00 by Timmy · 2 comments
Owner

What

src/timmy/agentic_loop.py has no dedicated test file. This module handles Timmy's agentic execution loop and needs coverage.

Acceptance criteria

  • Create tests/timmy/test_agentic_loop.py
  • Cover core loop logic, error handling, and edge cases
  • All tests pass via tox -e unit

Tags: [loop-generated] [test]

## What `src/timmy/agentic_loop.py` has no dedicated test file. This module handles Timmy's agentic execution loop and needs coverage. ## Acceptance criteria - Create `tests/timmy/test_agentic_loop.py` - Cover core loop logic, error handling, and edge cases - All tests pass via `tox -e unit` Tags: [loop-generated] [test]
Author
Owner

@kimi — Add unit tests for agentic_loop.py.

File to create: tests/timmy/test_agentic_loop.py
Module under test: src/timmy/agentic_loop.py

Key functions to test:

  • _parse_steps(plan_text) — parses numbered steps from text. Test with various formats.
  • run_agentic_loop(task, agent, ...) — async function, mock the agent's arun() method
  • AgenticStep and AgenticResult dataclasses — test construction and defaults

Pattern to follow: Look at tests/timmy/test_agent.py for mocking patterns.

Mock: _get_loop_agent() returns an agent — mock it. Mock _broadcast_progress().

Verify: tox -e unit passes with new tests.

@kimi — Add unit tests for agentic_loop.py. **File to create:** `tests/timmy/test_agentic_loop.py` **Module under test:** `src/timmy/agentic_loop.py` **Key functions to test:** - `_parse_steps(plan_text)` — parses numbered steps from text. Test with various formats. - `run_agentic_loop(task, agent, ...)` — async function, mock the agent's `arun()` method - `AgenticStep` and `AgenticResult` dataclasses — test construction and defaults **Pattern to follow:** Look at `tests/timmy/test_agent.py` for mocking patterns. **Mock:** `_get_loop_agent()` returns an agent — mock it. Mock `_broadcast_progress()`. **Verify:** `tox -e unit` passes with new tests.
Author
Owner

Kimi Instructions

Create tests/timmy/test_agentic_loop.py with unit tests for src/timmy/agentic_loop.py.

Files to modify

  • tests/timmy/test_agentic_loop.py (new)

Approach

  1. Read src/timmy/agentic_loop.py to understand the module's classes and functions
  2. Mock external dependencies (LLM calls, tool execution, file I/O)
  3. Test core loop logic: iteration limits, tool call dispatch, error handling, early exit conditions
  4. Test edge cases: empty responses, malformed tool calls, timeout behavior
  5. Run tox -e unit — all tests must pass
  6. Keep tests focused and fast — no real LLM calls, no network
## Kimi Instructions Create `tests/timmy/test_agentic_loop.py` with unit tests for `src/timmy/agentic_loop.py`. ### Files to modify - `tests/timmy/test_agentic_loop.py` (new) ### Approach 1. Read `src/timmy/agentic_loop.py` to understand the module's classes and functions 2. Mock external dependencies (LLM calls, tool execution, file I/O) 3. Test core loop logic: iteration limits, tool call dispatch, error handling, early exit conditions 4. Test edge cases: empty responses, malformed tool calls, timeout behavior 5. Run `tox -e unit` — all tests must pass 6. Keep tests focused and fast — no real LLM calls, no network
kimi was assigned by Timmy 2026-03-19 14:18:06 +00:00
Timmy closed this issue 2026-03-19 18:10:17 +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#421