From 0cf316e6ac8a5743d6ac1fbe6f6fe0eb1cfc8c91 Mon Sep 17 00:00:00 2001 From: Aakash Kattelu Date: Thu, 13 Aug 2026 10:22:42 -0700 Subject: [PATCH] chore: annotate RepresentationSaveError and assert truncate on re-embed --- src/exceptions.py | 4 ++-- tests/deriver/test_vector_reconciliation.py | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/exceptions.py b/src/exceptions.py index e4d7009c..41d775fe 100644 --- a/src/exceptions.py +++ b/src/exceptions.py @@ -137,8 +137,8 @@ class VectorStoreError(HonchoException): class RepresentationSaveError(HonchoException): """Raised when every observer's representation save fails in a batch.""" - status_code = 500 - detail = "Representation save failed for all observers" + status_code: int = 500 + detail: str = "Representation save failed for all observers" class LLMError(Exception): diff --git a/tests/deriver/test_vector_reconciliation.py b/tests/deriver/test_vector_reconciliation.py index b22d71a8..0ecd4d5c 100644 --- a/tests/deriver/test_vector_reconciliation.py +++ b/tests/deriver/test_vector_reconciliation.py @@ -552,10 +552,11 @@ class TestReEmbedding: batch_call_count = 0 async def track_batch_embed( - contents: list[str], **_kwargs: object + contents: list[str], *, on_oversize: str, **_kwargs: object ) -> list[list[float]]: nonlocal batch_call_count batch_call_count += 1 + assert on_oversize == "truncate" return [[1.0] * 1536 for _ in contents] with patch("src.reconciler.sync_vectors.embedding_client") as mock_embed_client: