From 3c4b9f2103e050a9d435276e8cadd8598c2a0dd6 Mon Sep 17 00:00:00 2001 From: Igor Monadical Date: Wed, 22 Oct 2025 13:45:08 -0400 Subject: [PATCH] chore: error reporting and naming (#708) * chore: error reporting and naming * chore: error reporting and naming --------- Co-authored-by: Igor Loskutov --- .github/workflows/deploy.yml | 2 +- server/reflector/pipelines/main_file_pipeline.py | 7 ++++++- server/reflector/processors/file_transcript_modal.py | 10 ++++++++++ .../processors/transcript_topic_detector.py | 12 ++++++++++-- 4 files changed, 27 insertions(+), 4 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 16e84df6..fe33dd84 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -1,4 +1,4 @@ -name: Deploy to Amazon ECS +name: Build container/push to container registry on: [workflow_dispatch] diff --git a/server/reflector/pipelines/main_file_pipeline.py b/server/reflector/pipelines/main_file_pipeline.py index bbf23e7b..0a05d593 100644 --- a/server/reflector/pipelines/main_file_pipeline.py +++ b/server/reflector/pipelines/main_file_pipeline.py @@ -426,7 +426,12 @@ async def task_pipeline_file_process(*, transcript_id: str): await pipeline.process(audio_file) - except Exception: + except Exception as e: + logger.error( + f"File pipeline failed for transcript {transcript_id}: {type(e).__name__}: {str(e)}", + exc_info=True, + transcript_id=transcript_id, + ) await pipeline.set_status(transcript_id, "error") raise diff --git a/server/reflector/processors/file_transcript_modal.py b/server/reflector/processors/file_transcript_modal.py index 82250b6c..d29b8eac 100644 --- a/server/reflector/processors/file_transcript_modal.py +++ b/server/reflector/processors/file_transcript_modal.py @@ -56,6 +56,16 @@ class FileTranscriptModalProcessor(FileTranscriptProcessor): }, follow_redirects=True, ) + + if response.status_code != 200: + error_body = response.text + self.logger.error( + "Modal API error", + audio_url=data.audio_url, + status_code=response.status_code, + error_body=error_body, + ) + response.raise_for_status() result = response.json() diff --git a/server/reflector/processors/transcript_topic_detector.py b/server/reflector/processors/transcript_topic_detector.py index e0e306ce..317e2d9c 100644 --- a/server/reflector/processors/transcript_topic_detector.py +++ b/server/reflector/processors/transcript_topic_detector.py @@ -34,8 +34,16 @@ TOPIC_PROMPT = dedent( class TopicResponse(BaseModel): """Structured response for topic detection""" - title: str = Field(description="A descriptive title for the topic being discussed") - summary: str = Field(description="A concise 1-2 sentence summary of the discussion") + title: str = Field( + description="A descriptive title for the topic being discussed", + validation_alias="Title", + ) + summary: str = Field( + description="A concise 1-2 sentence summary of the discussion", + validation_alias="Summary", + ) + + model_config = {"populate_by_name": True} class TranscriptTopicDetectorProcessor(Processor):