Repository navigation
Labels
effort/highEffort High: much work, in one pull requestpriority/p0-criticalPriority P0: a release blocker or a critical defectscope/aiAI review pipeline, personas, prompts, LLM client, or RAGsource/agentFiled by an agenttype/bugType bug: the code does not do what it mustvalue/highValue High: the delivery of the item matters much
Description
Problem
A model call of a roadmap job is retried in three layers that do not agree, and the failure that hurt most is retried by none of them.
| Layer | Retries | Source |
|---|---|---|
| Gateway (LiteLLM v1.103.11) | num_retries: 5 on the group, allowed_fails: 3, cooldown_time: 30, then the fallback deepseek-v4.1-flash-1017 -> deepseek-v4.1-flash; timeout: 1500 s for each attempt |
k8s/llm/gateway/config.yaml |
| Client, pydantic-ai path (refine, alternatives, stage, implement) | 3 attempts, fixed in code: async_http_client(level, retries=3); tenacity waits Retry-After or 1 s, 2 s (max 60 s) on transport errors, timeouts, 408, 429 and 5xx |
src/devops_cli/ai/providers/__init__.py:171-181, src/devops_cli/ai/retries/__init__.py |
| Client, direct path | ai.max_retries + 1 = 2 attempts |
src/devops_cli/ai/client/base.py |
Defects:
- A failure inside a streamed reply is not retried. On 2026-11-16 from 10:40Z to 11:35Z, OpenRouter timed out inside the stream (
OpenRouterException: A Timeout Occurredinchunk_parser, 12 times). The gateway and the client had a status 200 already, so no retry and no fallback ran, and the steps failed: refine 4, alternatives 3, stage 3, implement 2 (class=provider). - The pydantic-ai path ignores
ai.max_retries. The requirement "A model call in the cluster is sent at most two times" (feat(service): roadmap-service runs again at one replica, with one model retry in the cluster #2494,openspec/specs/roadmap-service-deployment/spec.md) and the ConfigMap value 1 do not reach it. - The retries multiply, and no deadline bounds them. 3 client attempts times 6 gateway attempts, plus the fallback, can send one call more than 18 times, and each attempt may wait 1500 s.
Over 7 days the :floor deployment had 964 failures in 44,521 calls (2.2%), and the fallback recovered 564.
Expected behavior
- One layer owns the retries of a gateway call: the gateway, which holds the fallback. The client retries only a connection that never reached the gateway, and it reads
ai.max_retries. - A stream that fails before its first token is retried or falls back. A stream that fails after its first token fails the call once, with a clear class.
- Each call has one total deadline, below the step time limit of its job (nested timeouts: the inner fires first).
Test first: a fake gateway that returns 200 and then breaks the stream before the first token gets one retry, and the pydantic-ai provider sends at most ai.max_retries + 1 attempts.
Related
Metadata
Metadata
Assignees
Labels
effort/highEffort High: much work, in one pull requestpriority/p0-criticalPriority P0: a release blocker or a critical defectscope/aiAI review pipeline, personas, prompts, LLM client, or RAGsource/agentFiled by an agenttype/bugType bug: the code does not do what it mustvalue/highValue High: the delivery of the item matters much
Activity
dan-petty commentedon Nov 16, 2026
Job steps are failing (refine, alternatives, stage, implement) due to unhandled stream timeouts and multiplied retries without a deadline.Both target retry in the pydantic-ai path, but #5806 fixes one specific reset during answer read while the candidate consolidates all retry layers, adds a total deadline, and handles stream failures before the first token.chore(main): release 0.164.0 (#5966)
devops-cli-service commentedon Nov 16, 2026
Released in v0.164.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.164.0
devops-cli-service commentedon Nov 16, 2026
Live since 2026-11-16 13:55 UTC
fix(k8s): Route DeepSeek 1017 without the floor variant (#5982)