Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

fix(logging): log lexical responses (#1136)

Eric Hayes37e2e39cac34
diff --git a/rust/cloud-storage/lexical_client/src/parse_markdown.rs b/rust/cloud-storage/lexical_client/src/parse_markdown.rs
index 94d1a33cfd..239ede3a2b 100644
--- a/rust/cloud-storage/lexical_client/src/parse_markdown.rs
+++ b/rust/cloud-storage/lexical_client/src/parse_markdown.rs
@@ -68,7 +68,15 @@ impl LexicalClient {
return Err(anyhow::anyhow!(body));
}
- response.json().await.context("unexpected response")
+ response
+ .json::<CognitionResponseData>()
+ .await
+ .context("unexpected response")
+ .inspect(|md| {
+ if md.data.is_empty() {
+ tracing::warn!(document_id=?document_id,"Empty MD content")
+ }
+ })
}
/// Parse markdown content from a presigned URL (for documents not in sync-service)
@@ -96,7 +104,15 @@ impl LexicalClient {
anyhow::bail!(body);
}
- response.json().await.context("unexpected response")
+ response
+ .json::<CognitionResponseData>()
+ .await
+ .context("unexpected response")
+ .inspect(|md| {
+ if md.data.is_empty() {
+ tracing::warn!(presigned_url=?presigned_url,"Empty MD content")
+ }
+ })
}
}