diff --git a/apps/web/src/app/api/openrouter/[...path]/route.ts b/apps/web/src/app/api/openrouter/[...path]/route.ts index 011a64332..a388a9a76 100644 --- a/apps/web/src/app/api/openrouter/[...path]/route.ts +++ b/apps/web/src/app/api/openrouter/[...path]/route.ts @@ -132,6 +132,17 @@ function extractPromptInfo(requestBodyParsed: GatewayRequest): PromptInfo { return extractChatCompletionsPromptInfo(requestBodyParsed.body); } +function determineFallbackFeature(requestBodyParsed: GatewayRequest): 'direct-gateway' | '' { + const { system_prompt_prefix } = extractPromptInfo(requestBodyParsed); + if ( + system_prompt_prefix.includes('You are Kilo') || + system_prompt_prefix.includes('You are a personal assistant running inside OpenClaw') + ) { + return ''; + } + return 'direct-gateway'; +} + async function resolveRateLimit( feature: FeatureValue | null, ipAddress: string, @@ -217,10 +228,9 @@ export async function POST(request: NextRequest): Promise