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:
parent
bc5eb61086
commit
cb157611df
4 changed files with 13 additions and 5 deletions
|
|
@ -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 }>;
|
||||
|
|
|
|||
|
|
@ -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 }>;
|
||||
|
|
|
|||
|
|
@ -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 }>;
|
||||
|
|
|
|||
|
|
@ -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)});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue