Skip to content

feat(core): reintento ante timeout/503 en llamadas a HF (E4-02)#46

Merged
g-garciac2022 merged 2 commits into
mainfrom
feat/E4-02-retry-hf
Jun 3, 2026
Merged

feat(core): reintento ante timeout/503 en llamadas a HF (E4-02)#46
g-garciac2022 merged 2 commits into
mainfrom
feat/E4-02-retry-hf

Conversation

@g-garciac2022

Copy link
Copy Markdown
Collaborator

E4-02 — Reintento ante fallos transitorios de HF

Closes #45

Contexto

El smoke test E2E del MVP (2026-06-03) confirmó que la inferencia remota de HF falla de forma transitoria: ~1 de cada 5 llamadas dio timeout (recurrente durante E3).

Qué incluye

  • BaseAPI.make_request — bucle de reintento opt-in por clase:
    • MAX_RETRIES (default 0 → Guardian/NYT no reintentan) y RETRY_BACKOFF; HFClient lo activa con MAX_RETRIES = 3.
    • Solo reintenta transitorios: httpx.TimeoutException y HTTP 503. Cualquier otro error falla al instante.
    • Contrato intacto: sigue devolviendo ToolResult.fail si se agotan los reintentos.
  • Tests (respx): 503→200 y timeout→200 (recupera al reintentar), 503 perpetuo → agota (MAX_RETRIES+1 intentos), y 500 → falla inmediato. Usan RETRY_BACKOFF = 0 para no esperar.
  • README: arranque de la Épica 4 + iteración E4-02.

Suite: 30 passed, 9 deselected.

@g-garciac2022 g-garciac2022 merged commit 3b4ee3d into main Jun 3, 2026
1 check passed
@g-garciac2022 g-garciac2022 deleted the feat/E4-02-retry-hf branch June 3, 2026 08:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[E4-02] feat(core): reintento ante timeout/503 en llamadas a HF

1 participant