Skip to content

ROADMAP-16 — P2 — retry.py ships two retry mechanisms; collapse to one #108

Open

Description

@getdownandcode

Series: ROADMAP — filed from the 2026-10-27 whole-project assessment · Backlog task: M16-T03 · Priority: P2 · Effort: extra small

Problem

retry.py ships two retry mechanisms: a generic decorator (retry_with_backoff) and a class wrapper (RetryingLLMClient) whose only consumer for the decorator is the wrapper itself. Maintaining both costs: aclose delegation, a __getattr__ proxy, and ~40 lines guarding a partial-init state that cannot occur (self._client is assigned first; the chained construction cannot realistically raise between the two).

Evidence

  • agentkit/llm/retry.py:91–130 — decorator (production consumer: the wrapper only, :153–159)
  • agentkit/llm/retry.py:133–191 — wrapper + delegations + guard

Suggested fix / acceptance criteria

  • Keep exactly one mechanism (wrapper recommended: it is what the factory injects and what aclose forwarding requires)
  • The impossible-state __getattr__ guard removed or justified in a comment with the concrete failure it prevents
  • Suite (incl. test_llm_retry.py) green

Suggested branch / commit

refactor/llm-retry-single-mechanism · refactor(llm): collapse retry.py to a single mechanism

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions