Fix research pipeline budget tracking

This commit is contained in:
faligam
2026-09-07 11:56:13 +02:00
parent a5324d3971
commit 5f237d535f
7 changed files with 148 additions and 17 deletions

View File

@@ -167,7 +167,10 @@ class CrawlerManager:
@staticmethod
def _error_doc(url: str, error: str) -> NormalizedDocument:
"""Create a NormalizedDocument representing an error."""
doc = NormalizedDocument(
# Keep the error result structurally identical to a successfully
# normalized document. ``from_text`` hashes the (empty) content, so
# downstream consumers can safely rely on content_hash being present.
doc = NormalizedDocument.from_text(
url=url,
text="",
title="",
@@ -176,7 +179,6 @@ class CrawlerManager:
"error": error,
"content_type": "error",
},
content_hash="",
extraction_tool="",
)
return doc