chore: annotate RepresentationSaveError and assert truncate on re-embed

This commit is contained in:
Aakash Kattelu 2026-08-13 10:22:42 -07:00
parent a946b26434
commit 0cf316e6ac
2 changed files with 4 additions and 3 deletions

View File

@ -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):

View File

@ -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: