From 058b19e7a65b40b1024a4fdeb2233062ff273cfd Mon Sep 17 00:00:00 2001 From: historia Date: Tue, 1 Sep 2026 03:17:01 -0400 Subject: fix: better errors for generate all models --- audiobook.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'audiobook.py') diff --git a/audiobook.py b/audiobook.py index 031ae1b..183bdc2 100755 --- a/audiobook.py +++ b/audiobook.py @@ -99,9 +99,12 @@ def _all_models_emit(progress, model_id: str, book_offset: int, Book events are renumbered into the run's global book sequence (BOOK_OFFSET plus the model's own index, GRAND_TOTAL overall) and stamped with the generating model; book_done/book_failed carry the - model too. The per-model "done"/"cancelled" events are swallowed — - the loop emits one merged "done" when every model has run — and - book_done outcomes are counted into COUNTS for that merged event. + model too. Every other converter event (chapter, chunks, chunk_done, + chunk_failed) is stamped with the model as well, so the run view can + attribute e.g. a chunk failure to the model that produced it. The + per-model "done"/"cancelled" events are swallowed — the loop emits one + merged "done" when every model has run — and book_done outcomes are + counted into COUNTS for that merged event. """ def emit(event: dict) -> None: kind = event.get("kind") @@ -116,7 +119,7 @@ def _all_models_emit(progress, model_id: str, book_offset: int, elif kind in ("done", "cancelled"): return else: - progress(event) + progress({**event, "model": model_id}) return emit -- cgit v1.2.3