Skip to content

fix(llm): wire RetryingLLMClient with MAX_RETRIES in LLM factory - #49

Merged
getdownandcode merged 2 commits into
mainfrom
fix/wire-llm-retry-wrapper
Oct 1, 2026
Merged

getdownandcode merged 2 commits into
mainfrom
fix/wire-llm-retry-wrapper

Conversation

@getdownandcode

Copy link
Copy Markdown
Owner

Summary

Wire RetryingLLMClient (exponential backoff and jitter for transient errors) into create_llm_client_from_settings (resolving AUD-04).

What Changed

  • In agentkit/config.py: Added MAX_RETRIES: int = Field(default=3, ge=0) to Settings.
  • In agentkit/llm/factory.py: Wrapped live providers (gemini and openai) with RetryingLLMClient(client, max_retries=settings.MAX_RETRIES) when MAX_RETRIES > 0.
  • In tests/unit/test_llm_factory.py: Added unit tests verifying wrapping, attribute delegation, and unwrapped behavior when MAX_RETRIES=0 or provider is fake.

How Tested

  • pytest tests/unit/test_llm_factory.py
  • Full test suite: 242 passed, 24 skipped (real infra flag).
  • Linting and typing: ruff and mypy 100% clean.

@getdownandcode getdownandcode left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Peer Review: Wire RetryingLLMClient into LLM Factory

  • Correctness: Verified. create_llm_client_from_settings wraps live LLM clients with RetryingLLMClient.
  • Configurability: Verified. Added MAX_RETRIES (default 3) to Settings. Zero retries returns unwrapped client.
  • Coverage & Quality: All tests green, type checks pass.

LGTM.

@getdownandcode
getdownandcode merged commit 146236d into main Oct 1, 2026
1 check passed
@getdownandcode
getdownandcode deleted the fix/wire-llm-retry-wrapper branch October 1, 2026 15:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant