From 975053f1789771ba5cb9dbe50ba7fe0aa396f0ab Mon Sep 17 00:00:00 2001 From: historia Date: Fri, 28 Aug 2026 00:59:47 -0400 Subject: fix: silently failing whisper transcription --- app/converter/clients/base.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'app/converter/clients/base.py') diff --git a/app/converter/clients/base.py b/app/converter/clients/base.py index d0d57fb..8a0b4e4 100644 --- a/app/converter/clients/base.py +++ b/app/converter/clients/base.py @@ -17,6 +17,19 @@ class ConversionCancelled(Exception): """Raised when the run's cancel event is set (between requests).""" +class NonRetryableTTSError(RuntimeError): + """A deterministic server-side request/config error; retrying cannot help. + + Raised by clients for failures that will reproduce identically on every + attempt (missing server-side reference transcripts, unknown model ids, + missing model contracts, ...). process_chunk_with_retry skips its + remaining attempts and back-off sleeps for these and re-raises, so the + converter aborts with the actionable message instead of burning the + retry budget on a request that can never succeed. Subclasses RuntimeError + so except-handlers written for the plain HTTP-error case keep working. + """ + + # How a run supplies its voice: a built-in CustomVoice speaker, by cloning # a reference audio clip (the faster and audiocpp backends always clone # server-side; only the Qwen client branches on this at request time), or @@ -109,6 +122,8 @@ class BaseTTSClient: Returns the generated chunk file's path, or None when all attempts failed. Raises ConversionCancelled when the run was cancelled. + NonRetryableTTSError is logged once and re-raised without consuming + the remaining attempts (the identical request can never succeed). """ for attempt in range(config.MAX_RETRIES): self._check_cancelled() @@ -119,6 +134,9 @@ class BaseTTSClient: logger.warning("Chunk %d attempt %d failed", chunk_num, attempt + 1) except ConversionCancelled: raise + except NonRetryableTTSError as exc: + logger.error("Chunk %d error (not retried): %s", chunk_num, exc) + raise except Exception as exc: logger.warning("Chunk %d attempt %d error: %s", chunk_num, attempt + 1, exc) -- cgit v1.2.3