diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 6e68e50b..b369818f 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -50,13 +50,21 @@ export default function App() { }.`, }; } else if (event.reflection) { + const reflectionEvent = event.reflection; + let searchText = "nothing specific"; + if ( + reflectionEvent.follow_up_queries && + Array.isArray(reflectionEvent.follow_up_queries) && + reflectionEvent.follow_up_queries.length > 0 + ) { + searchText = reflectionEvent.follow_up_queries.join(", "); + } + processedEvent = { title: "Reflection", - data: event.reflection.is_sufficient + data: reflectionEvent.is_sufficient ? "Search successful, generating final answer." - : `Need more information, searching for ${event.reflection.follow_up_queries.join( - ", " - )}`, + : `Need more information, searching for ${searchText}`, }; } else if (event.finalize_answer) { processedEvent = { diff --git a/frontend/vite.config.ts b/frontend/vite.config.ts index b5490299..f5a9a0a8 100644 --- a/frontend/vite.config.ts +++ b/frontend/vite.config.ts @@ -1,4 +1,5 @@ import path from "node:path"; +import { fileURLToPath } from "node:url"; // Added import import { defineConfig } from "vite"; import react from "@vitejs/plugin-react-swc"; import tailwindcss from "@tailwindcss/vite"; @@ -9,7 +10,8 @@ export default defineConfig({ base: "/app/", resolve: { alias: { - "@": path.resolve(new URL(".", import.meta.url).pathname, "./src"), + // Updated to use fileURLToPath for robustness + "@": path.resolve(path.dirname(fileURLToPath(import.meta.url)), "./src"), }, }, server: {