[BUG] Native Azure provider ignores timeout and max_retries on the completions path

Aperta
#9,880 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@Nezar-Alhammadi ci sta già lavorando.

Dal 27/11/2026.

  • #9881 di @Nezar-Alhammadi — aperta

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
25/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Ferma
Stack tecnologico
azure, python
Ambito
backend

Direzione di ricerca

Find AzureCompletion._make_client_kwargs() and compare the default completions path with the responses path, which already forwards these settings. Check the sync and async client construction and related tests for retry and timeout configuration. Done when both completions clients receive the expected retry and timeout values; linked pull request #9881 indicates work is already underway.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Description

LLM(model="azure/...", timeout=..., max_retries=...) accepts timeout and max_retries on AzureCompletion (and exports both in to_config_dict() and forwards them when api="responses"), but on the default api="completions" path _make_client_kwargs() never passes either setting to ChatCompletionsClient or AsyncChatCompletionsClient.

As a result:

  • max_retries (including max_retries=0 to disable SDK retries or a higher count like max_retries=5) is ignored, and both sync and async Azure clients always use azure-core's default total_retries=3 (even differing from AzureCompletion's own max_retries: int = 2 field default).
  • timeout is ignored, leaving connection_timeout and read_timeout at the 300s SDK defaults.

Minimal Reproduction

from crewai import LLM

llm = LLM(
    model="azure/gpt-4o",
    api_key="test-key",
    endpoint="https://example.openai.azure.com",
    timeout=15.0,
    max_retries=0,
)

sync_client = llm._get_sync_client()
print("total_retries:", sync_client._config.retry_policy.total_retries)  # 3 instead of 0
print("read_timeout:", sync_client._client._pipeline._transport.connection_config.read_timeout)  # 300 instead of 15.0

Expected Behavior

_make_client_kwargs() passes retry_total=self.max_retries and, when self.timeout is not None, connection_timeout=self.timeout and read_timeout=self.timeout so both the sync and async Azure AI Inference clients honor the configured retry and timeout settings.

Lingua principale
Python
Stelle
61.2k
Fork
9.2k
Merge medio
1g 14h
PR unite (30g)
180

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di crewAIInc/crewAI

Tutte le issue di crewAIInc/crewAI

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.