fix(captures): Play As autoplay + default voice + orphan recovery

- Hand /generate ids to the global SSE watcher so playback fires on completion. The mutation onSuccess was checking audio_path on a queued row, which is always empty — autoplay never ran.
- Bind the Play As voice selection to capture_settings.default_playback_voice_id, kept in sync with the Settings → Captures and Settings → MCP pickers. Picking from the split-button dropdown writes back to settings.
- Extract AudioBars from HistoryTable into a shared component; use it for the Play As generating state in place of Loader2.
- Stop the active-state hover from flashing white text when the button is in its lighter accent/10 fill.
- Drop the gradient avatar swatches from the Settings → Captures voice dropdown.
- Backend: when the gen worker exits without writing a terminal status (e.g. SQLite lock racing the failed-status write inside its own exception handler), the cancel endpoint now flips the row to failed instead of 409-ing. Worker also force-fails on its way out as a belt-and-suspenders.
This commit is contained in:
Jamie Pine
2026-04-24 19:49:36 -07:00
parent b97c565a45
commit 7ad91f5767
10 changed files with 123 additions and 104 deletions
+13 -1
View File
@@ -215,7 +215,19 @@ async def cancel_generation(generation_id: str, db: Session = Depends(get_db)):
cancellation_state = cancel_generation_job(generation_id)
if cancellation_state is None:
raise HTTPException(status_code=409, detail="Generation is no longer cancellable")
# Row says active but the worker is no longer tracking it — the gen
# coroutine exited without writing a terminal status (most often a
# SQLite lock racing with the failed-status write inside the worker's
# exception handler). Fail the row here so the user can move on.
task_manager = get_task_manager()
task_manager.complete_generation(generation_id)
await history.update_generation_status(
generation_id=generation_id,
status="failed",
db=db,
error="Generation orphaned by worker",
)
return {"message": "Orphaned generation cleared"}
if cancellation_state == "queued":
task_manager = get_task_manager()