Skip to content
2 changes: 1 addition & 1 deletion src/app/api/generate/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { generateWithWaveSpeed } from "./providers/wavespeed";
// Re-export for backward compatibility (test file imports from route)
export const clearFalInputMappingCache = _clearFalInputMappingCache;

export const maxDuration = 300; // 5 minute timeout (Vercel hobby plan limit)
export const maxDuration = 900; // 15 minute timeout (Vercel Pro limit)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Keep this route at the repository’s 5-minute timeout.

Changing maxDuration to 900 breaks the file-specific contract for src/app/api/generate/route.ts. If video jobs need 15 minutes, they should move to a separate endpoint or workflow instead of changing the shared generate route’s timeout here.

As per coding guidelines, "**/api/generate/route.ts: Image generation API route must have a 5 minute timeout in src/app/api/generate."

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/app/api/generate/route.ts` at line 25, The maxDuration constant in
src/app/api/generate/route.ts was increased to 900, violating the repository
rule that the shared generate route must use a 5-minute timeout; change the
exported constant maxDuration back to 300 (5 minutes) so the generate route
honors the file-specific contract, and if longer video jobs are required, move
them to a separate endpoint or workflow instead of modifying maxDuration here.

export const dynamic = 'force-dynamic'; // Ensure this route is always dynamic


Expand Down