Skip to content

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

fix(api): refine warning logic for low results in map controller to account for user-specified limit

Ademílson Tonatofc0ca3b48ccb
diff --git a/apps/api/src/controllers/v2/map.ts b/apps/api/src/controllers/v2/map.ts
index ca6dbd3c0..bcc788147 100644
--- a/apps/api/src/controllers/v2/map.ts
+++ b/apps/api/src/controllers/v2/map.ts
@@ -162,7 +162,12 @@ export async function mapController(
// Check if we should warn about base domain
let warning: string | undefined;
- if (result.mapResults.length <= 1 && !isBaseDomain(req.body.url)) {
+ // Only show warning if results <= 1 AND user didn't explicitly request limit=1 AND URL is not base domain
+ if (
+ result.mapResults.length <= 1 &&
+ req.body.limit !== 1 &&
+ !isBaseDomain(req.body.url)
+ ) {
const baseDomain = extractBaseDomain(req.body.url);
if (baseDomain) {
warning = `Only ${result.mapResults.length} result(s) found. For broader coverage, try mapping the base domain: ${baseDomain}`;