Skip to content

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

feat(monitor): stop exposing search depth/alertMode on the API; keep internal defaults

Developers Digestca1b4af04ec7
diff --git a/apps/api/src/services/monitoring/runner.ts b/apps/api/src/services/monitoring/runner.ts
index 02e78665d..abf2e2585 100644
--- a/apps/api/src/services/monitoring/runner.ts
+++ b/apps/api/src/services/monitoring/runner.ts
@@ -1002,7 +1002,11 @@ async function runMonitorSearchTarget(params: {
id: target.id,
queries: target.queries,
searchWindow: target.searchWindow,
- alertMode: target.alertMode,
+ // depth/alertMode are no longer settable via the API. Stored targets may
+ // still carry them (back-compat) so we pass them through; when absent,
+ // runSearchTarget derives depth (deep when judging on, raw when off) and
+ // alertMode defaults to "first_match".
+ alertMode: target.alertMode ?? "first_match",
includeDomains: target.includeDomains,
excludeDomains: target.excludeDomains,
recheckAfter: target.recheckAfter,
diff --git a/apps/api/src/services/monitoring/store.ts b/apps/api/src/services/monitoring/store.ts
index 384fdb059..d29c5ab85 100644
--- a/apps/api/src/services/monitoring/store.ts
+++ b/apps/api/src/services/monitoring/store.ts
@@ -156,6 +156,9 @@ function estimateTargetBaseCredits(target: MonitorTarget): number {
Math.ceil(Math.max(1, target.maxResults) / 10) *
SEARCH_CREDITS_PER_TEN_RESULTS *
Math.max(1, target.queries.length);
+ // depth is no longer settable via the API; absent depth means the runtime
+ // default ("deep" when judging is on). Only legacy stored targets carry an
+ // explicit "raw"/"standard". Treat absent depth as deep below.
if (target.depth === "raw") {
// No scrape, no LLM — only the search call.
return searchCallCredits;