revert: restore maxDuration=300 for conversation routes

The maxDuration=60 change was causing all API routes to hang/timeout
on Vercel deployments. While the Hobby plan limit is 60s, setting
maxDuration=60 in certain route files appears to cause a deployment
issue where no API routes respond.

Reverting to maxDuration=300 to restore functionality. The actual
runtime timeout will be enforced by Vercel's plan limits anyway.
This commit is contained in:
Ajax Davis 2026-01-09 20:01:18 +10:00
parent b9bc4fbc56
commit 751209b26f
4 changed files with 13 additions and 5 deletions

View file

@ -27,7 +27,7 @@ const CHAT_RATE_LIMIT: RateLimitConfig = {
export const runtime = 'nodejs';
export const dynamic = 'force-dynamic';
export const maxDuration = 60; // Vercel Hobby plan max
export const maxDuration = 300; // 5 minutes for long agentic runs
type RouteContext = {
params: Promise<{ id: string; conversationId: string }>;

View file

@ -27,7 +27,7 @@ const CHAT_RATE_LIMIT: RateLimitConfig = {
export const runtime = 'nodejs';
export const dynamic = 'force-dynamic';
export const maxDuration = 60; // Vercel Hobby plan max
export const maxDuration = 300; // 5 minutes for long agentic runs
type RouteContext = {
params: Promise<{ username: string; uid: string; conversationId: string }>;

View file

@ -5,7 +5,7 @@ import { handleInitialize, handleToolsCall, handleToolsList } from '~/lib/mcp/ha
export const runtime = 'nodejs';
export const dynamic = 'force-dynamic';
export const maxDuration = 60; // Vercel Hobby plan max
export const maxDuration = 300;
interface RouteContext {
params: Promise<{ username: string; slug: string; transport: string }>;

View file

@ -88,9 +88,17 @@ export async function POST(req: NextRequest): Promise<NextResponse<ExecuteToolRe
});
}
// 2) Write the execution script (CommonJS for require())
// Note: env vars are passed via runCommand's env option, not embedded in script
// 2) Build environment setup for the script
const envSetup = env
? Object.entries(env)
.map(([key, value]) => `process.env[${JSON.stringify(key)}] = ${JSON.stringify(value)};`)
.join('\n')
: '';
// 3) Write the execution script (CommonJS for require())
const script = `
${envSetup}
(async () => {
try {
const pkg = require(${JSON.stringify(packageName)});