fix: restore MCP telemetry compatibility and outcomes

Signed-off-by: phernandez <paul@basicmachines.co>
This commit is contained in:
phernandez
2026-03-28 15:31:13 -05:00
parent 98a2a3cbaf
commit 7696fca826
16 changed files with 370 additions and 59 deletions
+12 -4
View File
@@ -433,7 +433,9 @@ class EntityService(BaseService[EntityModel]):
action="update",
phase="upsert_entity",
):
entity = await self.upsert_entity_from_markdown(file_path, entity_markdown, is_new=False)
entity = await self.upsert_entity_from_markdown(
file_path, entity_markdown, is_new=False
)
with telemetry.scope(
"entity_service.update.update_checksum",
@@ -465,7 +467,9 @@ class EntityService(BaseService[EntityModel]):
action="fast_write",
phase="resolve_entity",
):
existing = await self.repository.get_by_external_id(external_id) if external_id else None
existing = (
await self.repository.get_by_external_id(external_id) if external_id else None
)
# Trigger: external_id already exists
# Why: avoid duplicate entities when title-derived paths change
@@ -698,7 +702,9 @@ class EntityService(BaseService[EntityModel]):
action="reindex",
phase="upsert_entity",
):
updated = await self.upsert_entity_from_markdown(file_path, entity_markdown, is_new=False)
updated = await self.upsert_entity_from_markdown(
file_path, entity_markdown, is_new=False
)
with telemetry.scope(
"entity_service.reindex.update_checksum",
domain="entity_service",
@@ -1019,7 +1025,9 @@ class EntityService(BaseService[EntityModel]):
action="edit",
phase="upsert_entity",
):
entity = await self.upsert_entity_from_markdown(file_path, entity_markdown, is_new=False)
entity = await self.upsert_entity_from_markdown(
file_path, entity_markdown, is_new=False
)
with telemetry.scope(
"entity_service.edit.update_checksum",
+4 -5
View File
@@ -174,10 +174,7 @@ class SearchService:
retrieval_mode = query.retrieval_mode or SearchRetrievalMode.FTS
strict_search_text = query.text
has_query = bool(
strict_search_text
or query.title
or query.permalink
or query.permalink_match
strict_search_text or query.title or query.permalink or query.permalink_match
)
has_filters = bool(
metadata_filters
@@ -658,7 +655,9 @@ class SearchService:
)
)
if len(obs_content_stems) > MAX_CONTENT_STEMS_SIZE: # pragma: no cover
obs_content_stems = obs_content_stems[:MAX_CONTENT_STEMS_SIZE] # pragma: no cover
obs_content_stems = obs_content_stems[
:MAX_CONTENT_STEMS_SIZE
] # pragma: no cover
rows_to_index.append(
SearchIndexRow(
id=obs.id,