fix(ollama): wrap timeout/connection errors so they retry#829
Open
dev-ploy wants to merge 2 commits into
Open
Conversation
|
✅ Health: 7.6 (unchanged) 📋 At a glance
🩹 Review priority (files here with the most recent bug-fix history — defects cluster, so review these first)
🔎 More signals (2)🔥 Hotspots touched (5)
2 more
🔗 Hidden coupling (2 files)
👀 Suggested reviewers @ecourn 📊 Full report · ⭐ Star Repowise · 📥 Install bot · Last updated 2026-07-14 16:01 UTC |
Parametrize the three test_generate_wraps_* cases over a shared helper to resolve the DRY violation flagged in review.
Author
|
Hi @RaghavChamadiya i would love your view on this solution |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
page_generation_failedfloods with local LLMs (Ollama):APITimeoutErrorand
APIConnectionErrorare siblings ofAPIStatusErrorunderopenai.APIError, so the old catch-only-APIStatusErrorclause let them escapeuncaught, skipping the tenacity retry loop entirely and surfacing as
page_generation_failedinorchestrate.py(run_level→guarded_named).(
provider_should_retry/provider_retry_stop/provider_retry_wait) with a3-way exception mapping (
RateLimitError→ 429,APIStatusError→ HTTP status,APIError→ transient) so transient timeout/connection errors retry whilenon-retryable 4xx (400/401/403/404/405/413/422) fail fast. Same wrapping applied
to both
stream_chatsites.APIErrorcatch to the other OpenAI-client providers(
openai,openrouter,deepseek), and warn when a local provider(
ollama/codex_cli/opencode) runs with--concurrency > 4.Related Issues
Closes #445
Test Plan
pytest) — 897 provider + CLI tests greenruff check) on all changed filesnpm run build) — N/A, no frontend changesAdditional manual verification against a live Ollama server, across multiple
locally running models:
repowise init --provider ollama --concurrency 6 --coverage 0.5runsagainst several local models → all pages generated with 0
page_generation_failed, and the local-provider concurrency warning shown.APITimeoutError(1 ms client timeout against the live server):now wrapped as
ProviderErrorand retried 3× instead of escaping raw.first attempt — no wasted retries.
Checklist