From 1e0b1ed970c127872f2eddd2ba44af72afdf2e0d Mon Sep 17 00:00:00 2001 From: Dayuan Jiang <34411969+DayuanJiang@users.noreply.github.com> Date: Sat, 6 Dec 2025 17:47:50 +0900 Subject: [PATCH] feat: make maxDuration configurable via MAX_DURATION env (#120) --- app/api/chat/route.ts | 2 +- env.example | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/api/chat/route.ts b/app/api/chat/route.ts index 89cc6ea..ea7774d 100644 --- a/app/api/chat/route.ts +++ b/app/api/chat/route.ts @@ -15,7 +15,7 @@ import { } from "@/lib/langfuse" import { getSystemPrompt } from "@/lib/system-prompts" -export const maxDuration = 300 +export const maxDuration = Number(process.env.MAX_DURATION) || 60 // File upload limits (must match client-side) const MAX_FILE_SIZE = 2 * 1024 * 1024 // 2MB diff --git a/env.example b/env.example index 7514843..8bafb9e 100644 --- a/env.example +++ b/env.example @@ -50,3 +50,6 @@ AI_MODEL=global.anthropic.claude-sonnet-4-5-20250929-v1:0 # Access Control (Optional) # ACCESS_CODE_LIST=your-secret-code,another-code + +# API Route Configuration (Optional) +# MAX_DURATION=60 # Max duration in seconds for API routes (default: 60)