Repository navigation
fix(prompt_client): gracefully handle invalid CRE_LLM_* env vars (#1169) - #1170
muntasir-396 wants to merge 1 commit into
Conversation
- Fall back to defaults and log a warning if CRE_LLM_MAX_RETRIES or CRE_LLM_RETRY_SLEEP_SECONDS contain non-integer values - Clamp negative retry and sleep values to 0 - Add unit tests verifying defaults, valid overrides, invalid strings, and negative values
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
Summary by CodeRabbit
WalkthroughThe retry policy now defaults to 2 retries and 15 seconds between retries. It parses environment values defensively, clamps negative values to zero, and logs warnings when values are invalid. Tests cover these cases. ChangesRetry policy configuration
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~8 minutes Change: Bug fix Merge Risk: ⚪ Minimal · up to
|
Closes #1169
Summary of Changes
CRE_LLM_MAX_RETRIESandCRE_LLM_RETRY_SLEEP_SECONDSparsing inretry_policy()(application/prompt_client/litellm_router.py) with defensivetry/except (ValueError, AttributeError)handling.DEFAULT_MAX_RETRIES = 2,DEFAULT_RETRY_SLEEP_SECONDS = 15) and logs a warning with the offending value if non-numeric/invalid strings are provided.0to prevent negative sleep intervals and invalid retry counts.application/tests/litellm_router_test.pycovering:Testing
Ran all tests with: