Skip to content

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

Move waitFor check for changeTracking to types.ts refine layer

Devin AI8bc2f167126b
diff --git a/apps/api/src/controllers/v1/types.ts b/apps/api/src/controllers/v1/types.ts
index 56a93072e..718cfba54 100644
--- a/apps/api/src/controllers/v1/types.ts
+++ b/apps/api/src/controllers/v1/types.ts
@@ -282,6 +282,10 @@ const extractTransform = (obj) => {
obj = { ...obj, timeout: 60000 };
}
+ if (obj.formats?.includes("changeTracking") && obj.waitFor < 5000) {
+ obj = { ...obj, waitFor: 5000 };
+ }
+
if (obj.formats?.includes("json")) {
obj.formats.push("extract");
}
diff --git a/apps/api/src/scraper/scrapeURL/index.ts b/apps/api/src/scraper/scrapeURL/index.ts
index 1408dde12..cedd275e2 100644
--- a/apps/api/src/scraper/scrapeURL/index.ts
+++ b/apps/api/src/scraper/scrapeURL/index.ts
@@ -390,9 +390,6 @@ export async function scrapeURL(
options: ScrapeOptions,
internalOptions: InternalOptions,
): Promise<ScrapeUrlResponse> {
- if (options.formats.includes("changeTracking") && options.waitFor < 5000) {
- options.waitFor = 5000;
- }
const meta = await buildMetaObject(id, url, options, internalOptions);
try {
while (true) {