diff --git a/bin/goose-ultra-final/src/components/LayoutComponents.tsx b/bin/goose-ultra-final/src/components/LayoutComponents.tsx index 50b5c23..f63dafe 100644 --- a/bin/goose-ultra-final/src/components/LayoutComponents.tsx +++ b/bin/goose-ultra-final/src/components/LayoutComponents.tsx @@ -2470,7 +2470,19 @@ Format: { "ideas": [{ "title": "Short Title", "subtitle": "One line", "tag": "To (window as any)._redesignApprovedSessions[state.activeProject.id] = true; } - if (isQaFailureArtifact) { + const isBackendRequest = userPrompt.includes('[BACKEND_REQUEST]'); + + if (isBackendRequest) { + // --- BACKEND GENERATION MODE --- + systemPrompt = `[SYSTEM INSTRUCTION]: BACKEND GENERATION REQUEST. + +The user wants to generate a server-side implementation for the existing frontend. +1. Analyze the provided frontend code in the user prompt. +2. Identify all API endpoints and data structures. +3. Propose a plan to create a 'server.js' (Node.js/Express) file. +4. The plan MUST start with '[PLAN]'. +5. Do NOT modify the frontend code. Only build the backend.`; + } else if (isQaFailureArtifact) { // --- REPAIR MODE (F3: Retention & Match) --- // "Broken frontend is treated as a REPAIR task" const originalIntent = state.activeProject?.originalPrompt || "Unknown Intent"; diff --git a/bin/goose-ultra-final/src/components/Views.tsx b/bin/goose-ultra-final/src/components/Views.tsx index f63dced..0153557 100644 --- a/bin/goose-ultra-final/src/components/Views.tsx +++ b/bin/goose-ultra-final/src/components/Views.tsx @@ -1452,8 +1452,8 @@ Start with "# 🔧 Repair Plan" and be concise.`; return; } - // Switch to Chat to show progress - dispatch({ type: 'SET_MODE', mode: GlobalMode.Chat }); + // Switch to Build mode (Plan tab) to show progress + dispatch({ type: 'SET_MODE', mode: GlobalMode.Build }); dispatch({ type: 'SET_TAB', tab: TabId.Plan }); const prompt = `[BACKEND_REQUEST]