Files
routstr-core/tests
9qeklajcandClaude Opus 5 5478fa1d8b fix(models): retry the OpenRouter catalogue fetch before giving up
OpenRouter occasionally answers /models with a truncated body, so the JSON
parse fails. Any exception returned [] for the whole fetch behind one log
line, leaving an enabled upstream advertising zero models, with no retry.

Split into a single-attempt helper plus a wrapper that retries it 3 times
and then returns [] as before. Only /models can fail an attempt; a failing
/embeddings/models logs a warning and contributes nothing, so a secondary
outage cannot empty the catalogue. Only transient errors retry — a 4xx gives
up immediately. The per-attempt timeout drops to 10s so three attempts stay
near the old budget: this fetch blocks startup and the refresh loop.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-23 21:52:49 +02:00
..
2025-08-06 20:31:55 -03:00