Skip to content

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

fix(api): don't throw SCRAPE_ACTIONS_NOT_SUPPORTED after document/pdf prefetch

Devin AI57c20c8b8a11
diff --git a/apps/api/src/scraper/scrapeURL/index.ts b/apps/api/src/scraper/scrapeURL/index.ts
index f959fc0fc..cc53ac83b 100644
--- a/apps/api/src/scraper/scrapeURL/index.ts
+++ b/apps/api/src/scraper/scrapeURL/index.ts
@@ -667,8 +667,15 @@ async function scrapeURLLoop(meta: Meta): Promise<ScrapeUrlResponse> {
const fallbackList = await buildFallbackList(meta);
- // Check if actions are requested but no engines support them
- if (meta.featureFlags.has("actions")) {
+ // Check if actions are requested but no engines support them.
+ // Skip when the content was already prefetched (a browser engine already
+ // ran the actions and downloaded the file); the re-run only needs the
+ // document/pdf engine to parse it, which does not support actions.
+ if (
+ meta.featureFlags.has("actions") &&
+ meta.pdfPrefetch === undefined &&
+ meta.documentPrefetch === undefined
+ ) {
if (
fallbackList.length === 0 ||
fallbackList.every(engine => engine.unsupportedFeatures.has("actions"))