diff --git a/CHANGELOG.md b/CHANGELOG.md index 80b842c1..74a4d6f5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,10 @@ - `hotpotqa` evaluation dataset. +### Fixed + +- Document deletion no longer raises `ConfigMismatchError` on embedding config drift. + ## [0.67.0] - 2026-07-16 ### Added diff --git a/haiku_rag_slim/haiku/rag/app.py b/haiku_rag_slim/haiku/rag/app.py index c7f95427..2b0401db 100644 --- a/haiku_rag_slim/haiku/rag/app.py +++ b/haiku_rag_slim/haiku/rag/app.py @@ -492,6 +492,7 @@ class HaikuRAGApp: # pragma: no cover db_path=self.db_path, config=self.config, read_only=self.read_only, + skip_validation=True, ) as self.client: deleted = await self.client.delete_document(doc_id) if deleted: diff --git a/haiku_rag_slim/haiku/rag/mcp.py b/haiku_rag_slim/haiku/rag/mcp.py index e2e9d1bd..8f3c000e 100644 --- a/haiku_rag_slim/haiku/rag/mcp.py +++ b/haiku_rag_slim/haiku/rag/mcp.py @@ -82,7 +82,9 @@ def create_mcp_server( async def delete_document(document_id: str) -> bool: """Delete a document by its ID.""" try: - async with HaikuRAG(db_path, config=config) as rag: + async with HaikuRAG( + db_path, config=config, skip_validation=True + ) as rag: return await rag.delete_document(document_id) except Exception: return False diff --git a/tests/test_cascade_delete.py b/tests/test_cascade_delete.py index 3963ffbf..5d68e375 100644 --- a/tests/test_cascade_delete.py +++ b/tests/test_cascade_delete.py @@ -1,5 +1,7 @@ +from haiku.rag.app import HaikuRAGApp from haiku.rag.client import HaikuRAG from haiku.rag.client.documents import parent_uri_filter +from haiku.rag.config.models import AppConfig from haiku.rag.store.models.document import Document @@ -126,6 +128,25 @@ async def test_delete_handles_self_referential_parent(temp_db_path): assert await client.get_document_by_id(doc.id) is None +async def test_delete_succeeds_with_embedding_dim_mismatch(temp_db_path): + """Deletion touches no embeddings, so a vector_dim mismatch must not block it.""" + async with HaikuRAG(temp_db_path, create=True) as client: + doc = await client.document_repository.create( + Document(content="body", uri="file:///doc.pdf", metadata={}) + ) + + mismatched = AppConfig() + mismatched.embeddings.model.vector_dim = 9999 + + app = HaikuRAGApp(db_path=temp_db_path, config=mismatched) + await app.delete_document(doc.id) + + async with HaikuRAG( + temp_db_path, config=mismatched, skip_validation=True + ) as client: + assert await client.get_document_by_id(doc.id) is None + + def test_processing_config_extract_pdf_attachments_default_true(): from haiku.rag.config.models import ProcessingConfig