llm: replace _retryable monkey-patch with RetryableLLMError subclass #85

Closed
opened 2026-07-05 14:07:22 +00:00 by the.auditor · 0 comments
Owner

In src/kronai/llm.py:78-88, the retryable error pattern uses object.__setattr__ to monkey-patch a _retryable flag on LLMError instances:

def _retryable(msg: str) -> LLMError:
    err = LLMError(msg)
    object.__setattr__(err, "_retryable", True)
    return err

Consider a RetryableLLMError(LLMError) subclass for a cleaner, more idiomatic design.

From PR #84 review suggestion.

In `src/kronai/llm.py:78-88`, the retryable error pattern uses `object.__setattr__` to monkey-patch a `_retryable` flag on `LLMError` instances: ```python def _retryable(msg: str) -> LLMError: err = LLMError(msg) object.__setattr__(err, "_retryable", True) return err ``` Consider a `RetryableLLMError(LLMError)` subclass for a cleaner, more idiomatic design. _From PR #84 review suggestion._
fuzzy closed this issue 2026-07-05 16:30:07 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
thwap/kronai#85
No description provided.