Skip to content

🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

fix: maxDuration must use literal

YuTengjing0e49d1162145
diff --git a/packages/business/config/src/server/route.ts b/packages/business/config/src/server/route.ts
index 36d88e4ecf5..aeb0255cfee 100644
--- a/packages/business/config/src/server/route.ts
+++ b/packages/business/config/src/server/route.ts
@@ -1,9 +1,9 @@
// set timeout to about 5 minutes, and give 2s padding time
export const ASYNC_TASK_TIMEOUT = (60 * 5 - 2) * 1000;
-// trpc routes max duration
-export const TRPC_ASYNC_MAX_DURATION: number | undefined = undefined;
-export const TRPC_TOOLS_MAX_DURATION: number | undefined = undefined;
+// // trpc routes max duration
+// export const TRPC_ASYNC_MAX_DURATION: number | undefined = undefined;
+// export const TRPC_TOOLS_MAX_DURATION: number | undefined = undefined;
-export const WEBAPI_CHAT_MAX_DURATION: number = 300;
-export const WEBAPI_PLUGIN_GATEWAY_MAX_DURATION: number | undefined = undefined;
+// export const WEBAPI_CHAT_MAX_DURATION: number = 300;
+// export const WEBAPI_PLUGIN_GATEWAY_MAX_DURATION: number | undefined = undefined;
diff --git a/src/app/(backend)/trpc/async/[trpc]/route.ts b/src/app/(backend)/trpc/async/[trpc]/route.ts
index 8a2b5a7e50b..f14fab4bcab 100644
--- a/src/app/(backend)/trpc/async/[trpc]/route.ts
+++ b/src/app/(backend)/trpc/async/[trpc]/route.ts
@@ -34,5 +34,3 @@ const handler = (req: NextRequest) => {
};
export { handler as GET, handler as POST };
-
-export { TRPC_ASYNC_MAX_DURATION as maxDuration } from '@lobechat/business-config/server';
diff --git a/src/app/(backend)/trpc/tools/[trpc]/route.ts b/src/app/(backend)/trpc/tools/[trpc]/route.ts
index c2023ae80db..b0ff0de8570 100644
--- a/src/app/(backend)/trpc/tools/[trpc]/route.ts
+++ b/src/app/(backend)/trpc/tools/[trpc]/route.ts
@@ -6,8 +6,6 @@ import { createLambdaContext } from '@/libs/trpc/lambda/context';
import { prepareRequestForTRPC } from '@/libs/trpc/utils/request-adapter';
import { toolsRouter } from '@/server/routers/tools';
-export { TRPC_TOOLS_MAX_DURATION as maxDuration } from '@lobechat/business-config/server';
-
const handler = (req: NextRequest) => {
// Clone the request to avoid "Response body object should not be disturbed or locked" error
// in Next.js 16 when the body stream has been consumed by Next.js internal mechanisms
diff --git a/src/app/(backend)/webapi/chat/[provider]/route.ts b/src/app/(backend)/webapi/chat/[provider]/route.ts
index 5436ada429b..cc712705b80 100644
--- a/src/app/(backend)/webapi/chat/[provider]/route.ts
+++ b/src/app/(backend)/webapi/chat/[provider]/route.ts
@@ -11,7 +11,9 @@ import { ChatStreamPayload } from '@/types/openai/chat';
import { createErrorResponse } from '@/utils/errorResponse';
import { getTracePayload } from '@/utils/trace';
-export { WEBAPI_CHAT_MAX_DURATION as maxDuration } from '@lobechat/business-config/server';
+// If user don't use fluid compute, will build failed
+// this enforce user to enable fluid compute
+export const maxDuration = 300;
export const POST = checkAuth(async (req: Request, { params, jwtPayload, createRuntime }) => {
const provider = (await params)!.provider!;
diff --git a/src/app/(backend)/webapi/plugin/gateway/route.ts b/src/app/(backend)/webapi/plugin/gateway/route.ts
index d8f497575d6..af5c8e0263c 100644
--- a/src/app/(backend)/webapi/plugin/gateway/route.ts
+++ b/src/app/(backend)/webapi/plugin/gateway/route.ts
@@ -80,5 +80,3 @@ export const POST = async (req: Request) => {
return res;
};
-
-export { WEBAPI_PLUGIN_GATEWAY_MAX_DURATION as maxDuration } from '@lobechat/business-config/server';