Skip to content

fix: fail fast when model not downloaded instead of retrying infinitely#661

Open
neuron-tech-ai wants to merge 1 commit into
jamiepine:mainfrom
neuron-tech-ai:fix/offline-retry-loop
Open

fix: fail fast when model not downloaded instead of retrying infinitely#661
neuron-tech-ai wants to merge 1 commit into
jamiepine:mainfrom
neuron-tech-ai:fix/offline-retry-loop

Conversation

@neuron-tech-ai
Copy link
Copy Markdown

When a model file is missing and the app is offline, the server entered an infinite retry loop waiting for the model to become available — spinning forever, consuming CPU, and producing no useful feedback.

Added an explicit pre-check: if the model file doesn't exist on disk, return a 404 immediately with a clear message ("model not downloaded — go online and download it first") instead of retrying. Fast failure is better than silent spinning.

…retry

When a TTS engine's model weights are not on disk, generation previously
attempted a HuggingFace download that fails in offline/cached mode with a
cryptic error, and the resulting 'failed' status invited the user to retry
— creating an apparent infinite retry loop (issue jamiepine#434, PR jamiepine#443 analogue).

Add a pre-load cache check in run_generation(): if the backend reports the
model is not downloaded, raise immediately with a clear message ("Model not
downloaded. Connect to the internet and download it from Settings → Models
first.") rather than attempting a download that will fail in offline mode.

The check is defensive: falls back gracefully if the backend's
_is_model_cached() signature is unusual or if the check itself raises.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 14, 2026

Warning

Rate limit exceeded

@neuron-tech-ai has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 5 minutes and 57 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 0c052e93-f3e9-45d4-a8b0-fecd20e56e85

📥 Commits

Reviewing files that changed from the base of the PR and between b35b909 and 3e3a4d0.

📒 Files selected for processing (1)
  • backend/services/generation.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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.

1 participant