fix(llm_config): extend retry delays to respect rate limit windows (#9489)

This commit is contained in:
llamantino
2025-07-25 19:26:39 +02:00
committed by GitHub
parent 3ce19993bc
commit 0651c51901
2 changed files with 6 additions and 6 deletions

View File

@@ -57,11 +57,11 @@ class LLMConfig(BaseModel):
aws_region_name: str | None = Field(default=None)
openrouter_site_url: str = Field(default='https://docs.all-hands.dev/')
openrouter_app_name: str = Field(default='OpenHands')
# total wait time: 5 + 10 + 20 + 30 = 65 seconds
num_retries: int = Field(default=4)
retry_multiplier: float = Field(default=2)
retry_min_wait: int = Field(default=5)
retry_max_wait: int = Field(default=30)
# total wait time: 8 + 16 + 32 + 64 = 120 seconds
num_retries: int = Field(default=5)
retry_multiplier: float = Field(default=8)
retry_min_wait: int = Field(default=8)
retry_max_wait: int = Field(default=64)
timeout: int | None = Field(default=None)
max_message_chars: int = Field(
default=30_000

View File

@@ -175,7 +175,7 @@ api_key = "custom-only-api-key"
custom_only = default_config.get_llm_config('custom_only')
assert custom_only.model == 'custom-only-model'
assert custom_only.api_key.get_secret_value() == 'custom-only-api-key'
assert custom_only.num_retries == 4 # default value
assert custom_only.num_retries == 5 # default value
def test_load_from_toml_llm_invalid_config(