mirror of
https://github.com/simstudioai/sim.git
synced 2026-09-24 15:45:35 +08:00
fix(nextjs): add force dynamic exports for new copilot routes (#784)
* feat: use 8-core self-hosted runner for faster Docker builds * fix: lazy load large YAML prompt to prevent build memory exhaustion - Convert YAML_WORKFLOW_PROMPT from static export to lazy function - Prevents 281-line string literal from being loaded during static generation - Fixes exit code 137 memory exhaustion during Docker builds * fix(nextjs): add force dynamic for copilot routes to resolve OOM issue
This commit is contained in:
@@ -7,7 +7,7 @@ on:
|
||||
|
||||
jobs:
|
||||
build-and-push:
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ubuntu-latest-8-cores
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
|
||||
@@ -14,6 +14,8 @@ import { copilotCheckpoints, workflow as workflowTable } from '@/db/schema'
|
||||
import { generateLoopBlocks, generateParallelBlocks } from '@/stores/workflows/workflow/utils'
|
||||
import { convertYamlToWorkflow, parseWorkflowYaml } from '@/stores/workflows/yaml/importer'
|
||||
|
||||
export const dynamic = 'force-dynamic'
|
||||
|
||||
const logger = createLogger('EditWorkflowAPI')
|
||||
|
||||
export async function POST(request: NextRequest) {
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
import { type NextRequest, NextResponse } from 'next/server'
|
||||
import { YAML_WORKFLOW_PROMPT } from '../../../../lib/copilot/prompts'
|
||||
import { getYamlWorkflowPrompt } from '@/lib/copilot/prompts'
|
||||
|
||||
export const dynamic = 'force-dynamic'
|
||||
|
||||
export async function POST(request: NextRequest) {
|
||||
try {
|
||||
@@ -8,7 +10,7 @@ export async function POST(request: NextRequest) {
|
||||
return NextResponse.json({
|
||||
success: true,
|
||||
data: {
|
||||
guide: YAML_WORKFLOW_PROMPT,
|
||||
guide: getYamlWorkflowPrompt(),
|
||||
message: 'Complete YAML workflow syntax guide with examples and best practices',
|
||||
},
|
||||
})
|
||||
@@ -17,7 +19,7 @@ export async function POST(request: NextRequest) {
|
||||
return NextResponse.json(
|
||||
{
|
||||
success: false,
|
||||
error: 'Failed to get YAML structure guide',
|
||||
error: 'Failed to get YAML structure',
|
||||
},
|
||||
{ status: 500 }
|
||||
)
|
||||
|
||||
@@ -12,6 +12,8 @@ import {
|
||||
import { db } from '@/db'
|
||||
import { workflow as workflowTable } from '@/db/schema'
|
||||
|
||||
export const dynamic = 'force-dynamic'
|
||||
|
||||
const logger = createLogger('AutoLayoutAPI')
|
||||
|
||||
const AutoLayoutRequestSchema = z.object({
|
||||
|
||||
@@ -17,6 +17,8 @@ import { copilotCheckpoints, workflow as workflowTable } from '@/db/schema'
|
||||
import { generateLoopBlocks, generateParallelBlocks } from '@/stores/workflows/workflow/utils'
|
||||
import { convertYamlToWorkflow, parseWorkflowYaml } from '@/stores/workflows/yaml/importer'
|
||||
|
||||
export const dynamic = 'force-dynamic'
|
||||
|
||||
const logger = createLogger('WorkflowYamlAPI')
|
||||
|
||||
// Request schema for YAML workflow operations
|
||||
|
||||
@@ -376,10 +376,11 @@ export const TITLE_GENERATION_USER_PROMPT = (userMessage: string) =>
|
||||
`Generate a concise title for a conversation that starts with this user message: "${userMessage}"\n\nReturn only the title text, nothing else.`
|
||||
|
||||
/**
|
||||
* YAML Workflow Reference Guide
|
||||
* Comprehensive guide for LLMs on how to write end-to-end YAML workflows correctly
|
||||
* Lazy loaded to prevent memory issues during static generation
|
||||
*/
|
||||
export const YAML_WORKFLOW_PROMPT = `# Comprehensive Guide to Writing End-to-End YAML Workflows in Sim Studio
|
||||
export const getYamlWorkflowPrompt =
|
||||
() => `# Comprehensive Guide to Writing End-to-End YAML Workflows in Sim Studio
|
||||
|
||||
## Fundamental Structure
|
||||
|
||||
|
||||
Reference in New Issue
Block a user