Skip to content

Supercharge your AI agents with data from the web and beyond. Building the library for superintelligence. 🔥

monitor search: warn when a check retrieves zero results

Developers Digest596c7259e315
diff --git a/apps/api/src/services/monitoring/search/run.ts b/apps/api/src/services/monitoring/search/run.ts
index 9a2050ba5..667905849 100644
--- a/apps/api/src/services/monitoring/search/run.ts
+++ b/apps/api/src/services/monitoring/search/run.ts
@@ -342,6 +342,20 @@ export async function runSearchTarget(params: {
}
resultCount = candidates.length;
+ // A check that retrieves nothing looks identical to "nothing happened", so a
+ // genuine miss (search came back empty despite relevant content existing) is
+ // invisible. Surface it explicitly so empty-retrieval can be diagnosed/alerted on.
+ if (resultCount === 0) {
+ logger.warn(
+ "search monitor: all queries returned no results after retries",
+ {
+ queries: target.queries,
+ searchWindow: target.searchWindow,
+ includeDomains: target.includeDomains,
+ },
+ );
+ }
+
const llmStagesAvailable = hasLlmProvider();
const depth: "raw" | "standard" | "deep" = !judgeEnabled
? "raw"