Compare commits

...
Author SHA1 Message Date
Andrew BeveridgeandClaude Opus 4.5 271bd5fa38 fix: Handle list response in encoding service wait_for_completion
The GCE encoding worker sometimes returns a list instead of a dict
from the /status endpoint. PR #186 added handling for this in the
encode() method, but the same issue occurs in wait_for_completion()
which polls for job status.

Added defensive handling to convert list responses to dicts before
accessing status and progress fields.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-04 17:30:31 -05:00
2 changed files with 10 additions and 1 deletions

No files matched your search

+9
View File
@@ -177,6 +177,15 @@ class EncodingService:
raise TimeoutError(f"Encoding job {job_id} timed out after {timeout}s")
status = await self.get_job_status(job_id)
# Handle case where GCE worker returns a list instead of dict
if isinstance(status, list):
logger.warning(f"[job:{job_id}] GCE returned list instead of dict: {status}")
status = status[0] if status and isinstance(status[0], dict) else {}
if not isinstance(status, dict):
logger.error(f"[job:{job_id}] Unexpected status type: {type(status)}")
status = {}
job_status = status.get("status", "unknown")
progress = status.get("progress", 0)
+1 -1
View File
@@ -1,6 +1,6 @@
[tool.poetry]
name = "karaoke-gen"
version = "0.89.4"
version = "0.89.5"
description = "Generate karaoke videos with synchronized lyrics. Handles the entire process from downloading audio and lyrics to creating the final video with title screens."
authors = ["Andrew Beveridge <andrew@beveridge.uk>"]
license = "MIT"