Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
merged
  • Loading branch information
Your Name
Your Name committed Sep 26, 2026
commit 8100780adf194c1b38650eebffb945fea8bc5ec6
4 changes: 2 additions & 2 deletions cecli/coders/base_coder.py
Original file line number Diff line number Diff line change
Expand Up @@ -2828,7 +2828,7 @@ async def format_in_executor():
except EmptyResponseError:
self.io.tool_warning(self.empty_llm_tool_warning())

retry_config = models._parse_retry_config(self.get_active_model().retries)
retry_config = models.parse_retry_config(self.get_active_model().retries)
retry_on_empty = retry_config["retry_on_empty"]

if not retry_on_empty:
Expand All @@ -2855,7 +2855,7 @@ async def format_in_executor():
exhausted = True
break

retry_config = models._parse_retry_config(self.get_active_model().retries)
retry_config = models.parse_retry_config(self.get_active_model().retries)

should_retry = ex_info.retry
if ex_info.name == "ServiceUnavailableError":
Expand Down
23 changes: 17 additions & 6 deletions cecli/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1452,10 +1452,21 @@ async def send_completion(
litellm_ex = LiteLLMExceptions()
retry_delay = 0.125

retry_config = _parse_retry_config(self.retries)
self.retry_on_unavailable = retry_config["retry_on_unavailable"]
self.retry_backoff_factor = retry_config["retry_backoff_factor"]
self.retry_timeout = retry_config["retry_timeout"]
if self.retries:
retry_config = dict()
try:
retry_config = json.loads(self.retries)
except (json.JSONDecodeError, TypeError, ValueError):
retry_config = dict()
pass

self.retry_on_unavailable = bool(
nested.getter(retry_config, "retry-on-unavailable", True)
)
self.retry_backoff_factor = float(
nested.getter(retry_config, "retry-backoff-factor", 1.5)
)
self.retry_timeout = float(nested.getter(retry_config, "retry-timeout", 30))

while True:
try:
Expand Down Expand Up @@ -1546,7 +1557,7 @@ async def simple_send_with_retries(
temperature = None
tools = None

retry_config = _parse_retry_config(self.retries)
retry_config = parse_retry_config(self.retries)
retry_backoff_factor = retry_config["retry_backoff_factor"]
retry_timeout = retry_config["retry_timeout"]
retry_on_unavailable = retry_config["retry_on_unavailable"]
Expand Down Expand Up @@ -1789,7 +1800,7 @@ def _configured_provider(self) -> str:
return provider


def _parse_retry_config(retries_input):
def parse_retry_config(retries_input):
"""
Parse and normalize retry configuration from a JSON string or dict.
Returns a unified dict with defaults:
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.