Skip to content

RuntimeError: Failed to create chat completion after 10 retries. #1343

Description

@baolicheng0510-code

[## ❓ Questions and Help

when I run rdagent fin_factor_report , the error as the title occurred . could anyone tell me how to solve it. The log is as follows:

2026-03-11 13:29:10.431 | WARNING | rdagent.oai.backend.base:_try_create_chat_completion_or_embedding:610 - Failed to continue the conversation after 6 retries.
2026-03-11 13:29:10.433 | WARNING | rdagent.oai.backend.base:try_create_chat_completion_or_embedding:611 - Retrying 10th time...
Workflow Progress: 20%|██ | 1/5 [00:00<00:00, 1036.14step/s, loop_index=0, step_index=1, step_name=coding]
...
│ │
│ /home/baolc/RD-Agent/rdagent/oai/backend/base.py:318 in │
│ build_chat_completion │
│ │
│ 315 │ │ │
│ 316 │ │ with logger.tag(f"session
{self.conversation_id}"): │
│ 317 │ │ │ start_time = datetime.now(pytz.timezone("Asia/Shanghai")) │
│ ❱ 318 │ │ │ response: str = self.api_backend._try_create_chat_completi │
│ 319 │ │ │ │ *args, │
│ 320 │ │ │ │ messages=messages, │
│ 321 │ │ │ │ chat_completion=True, │
│ │
│ /home/baolc/RD-Agent/rdagent/oai/backend/base.py:613 in │
try_create_chat_completion_or_embedding │
│ │
│ 610 │ │ │ │ logger.warning(str(e)) │
│ 611 │ │ │ │ logger.warning(f"Retrying {i+1}th time...") │
│ 612 │ │ error_message = f"Failed to create chat completion after {max

│ ❱ 613 │ │ raise RuntimeError(error_message) │
│ 614 │ │
│ 615 │ def _add_json_in_prompt(self, messages: list[dict[str, Any]]) -> N │
│ 616 │ │ """ │
RuntimeError: Failed to create chat completion after 10 retries.

here is my .env file:
Image

and rdagent health_check is ok.

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions