Interactions retries ignore the documented `initial_delay` and `max_delay` defaults
Mantenedores costumam responder em até 1 dia
Avaliação
- Dificuldade
- 2/5
- Tempo estimado
- 1-3 horas
- Facilidade para iniciantes
- 68/100
- Tipo de issue
- Bug
- Clareza
- Razoavelmente clara
- Status de atividade
- Ativa
- Stack de tecnologia
- python
- Domínio
- backend-api-design
Direção de pesquisa
Leia types.py em torno dos valores padrão de HttpRetryOptions e _gaos/google_genai.py em torno de _DEFAULT_INITIAL_INTERVAL_MS; em seguida, compare-os com os valores padrão de novas tentativas em _api_client. A issue relata atrasos de novas tentativas e jitter diferentes para client.interactions e client.models; decida se Interactions deve usar os valores padrão compartilhados e verifique os cronogramas de novas tentativas com a reprodução sem rede fornecida.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
client.interactions backs off half as long as client.models when initial_delay and max_delay are left unset, so the same HttpRetryOptions give two different retry schedules in one client.
Repro at afb10e8 (3.0.0), with no network and no real key:
import time, httpx2
from google import genai
from google.genai import types
stamps = []
def handler(request):
stamps.append(time.monotonic())
return httpx2.Response(503, json={"error": {"code": 503, "message": "unavailable", "status": "UNAVAILABLE"}})
def gaps():
return [round(b - a, 1) for a, b in zip(stamps, stamps[1:])]
retry = types.HttpRetryOptions(attempts=4, jitter=0) # jitter=0 keeps the gaps exact; delays left unset
client = genai.Client(
api_key="test",
http_options=types.HttpOptions(
retry_options=retry, httpx_client=httpx2.Client(transport=httpx2.MockTransport(handler))
),
)
for name, call in [
("models.generate_content", lambda: client.models.generate_content(model="gemini-3.8-flash", contents="hi")),
("interactions.create", lambda: client.interactions.create(model="gemini-3.8-flash", input="hi")),
]:
stamps.clear()
try:
call()
except Exception as e:
print(f"{name}: {len(stamps)} requests, gaps {gaps()} s, {type(e).__name__}")
$ python repro.py
models.generate_content: 4 requests, gaps [1.0, 2.0, 4.0] s, ServerError
interactions.create: 4 requests, gaps [0.5, 1.0, 2.0] s, InternalServerError
HttpRetryOptions documents initial_delay as "If not specified, default to 1.0 second" and max_delay as "default to 60.0 seconds" (types.py:2671-2678). The comment above _DEFAULT_INITIAL_INTERVAL_MS in _gaos/google_genai.py calls 0.5 s and 8 s the default, so one of the two contracts is wrong. An unset jitter differs too: Interactions takes up to 25% off each delay, while client.models adds up to 1 s. #3263 already moved the unset attempts onto _api_client._RETRY_ATTEMPTS. I checked the sync client only.
I'd take all three from _api_client (_RETRY_INITIAL_DELAY, _RETRY_MAX_DELAY, _RETRY_JITTER) in the same way. Or are 0.5 s and 8 s meant to stay specific to Interactions?
- Linguagem predominante
- Python
- Estrelas
- 4.1k
- Forks
- 1.1k
- Merge médio
- 1d 20h
- PRs com merge (30d)
- 99
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Sem modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de googleapis/python-genai
-
Test import module that doesn't existTalvez já em andamento @Venkaiahbabuneelam assumiu há 25 dias. Abertapriority: p2 type: bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 66/100
googleapis/python-genai#3122 · 6 comentários · 1 responsável ·
Mantenedores costumam responder em até 1 dia
-
Curated history keeps half a user turn when the model turn is invalidTalvez já em andamento @Venkaiahbabuneelam assumiu há 34 dias. Abertapriority: p2 type: bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 62/100
googleapis/python-genai#3051 · 3 comentários · 1 responsável ·
Mantenedores costumam responder em até 1 dia
-
[Bug]: Unsubscripted typing.List and typing.Dict crash convert_if_exist_pydantic_model in AFCTalvez já em andamento @Venkaiahbabuneelam assumiu há 34 dias. Abertapriority: p2 type: bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
googleapis/python-genai#3044 · 1 comentário · 1 responsável ·
Mantenedores costumam responder em até 1 dia
-
all `client.webhooks` operations fail with API error occurred: Status 404Talvez já em andamento @VISHNU0906 assumiu hoje. Abertapriority: p2 type: bug
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 54/100
googleapis/python-genai#3316 ·
Mantenedores costumam responder em até 1 dia
-
Curated chat history ends on an unanswered function_call when the turn after AFC is invalidTalvez já em andamento @copybara-service assumiu há 1 dia. Aberta
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 48/100
googleapis/python-genai#3314 ·
Mantenedores costumam responder em até 1 dia
Todas as issues de googleapis/python-genai
Issues semelhantes
-
S9.7: Methodology pageAbertaarea: web priority: P1 story
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
nfiasco/Quant-Time-Machine#151 ·
Mantenedores costumam responder em até 1 dia
-
Broken links found in docsAbertadocs pydanty:is-working
Dificuldade 1/5 1-3 horas Facilidade para iniciantes 85/100
pydantic/pydantic-ai#12892 ·
Mantenedores costumam responder em até 1 dia
-
needs-triage
Dificuldade 1/5 1-3 horas Facilidade para iniciantes 72/100
Azure/azure-sdk-for-python#49886 · 1 comentário · 1 reação ·
Mantenedores costumam responder em até 1 dia
-
[Core] Deprecated(error=True) raises only on the first call; later calls run the removed APITalvez já em andamento @wguo7 assumiu hoje. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
ray-project/ray#67965 ·
Mantenedores costumam responder em até 2 dias
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 88/100
btclib-org/btclib#3006 ·
Mantenedores costumam responder em até 1 dia