diff --git a/backend/app/services/task_manager.py b/backend/app/services/task_manager.py index 5b694698..b59f01e4 100644 --- a/backend/app/services/task_manager.py +++ b/backend/app/services/task_manager.py @@ -157,7 +157,7 @@ class InMemoryTaskManager: task_id: Task ID Returns: - Dictionary with task status information + Dictionary with task status information including all required fields """ task = self.get_task(task_id) if not task: @@ -166,9 +166,12 @@ class InMemoryTaskManager: return { "task_id": task["task_id"], "status": task["status"], + "created_at": task.get("created_at"), + "updated_at": task.get("updated_at", task.get("created_at")), # Fallback to created_at if updated_at not set "progress": task.get("progress"), "result": task.get("result"), "error": task.get("error"), + "completed_at": task.get("completed_at"), } def delete_task(self, task_id: str): diff --git a/frontend/next.config.js b/frontend/next.config.js deleted file mode 100644 index fa02ad82..00000000 --- a/frontend/next.config.js +++ /dev/null @@ -1,17 +0,0 @@ -const nextConfig = { - output: 'standalone', - async rewrites() { - // Use BACKEND_URL env var, or fallback to public Railway URL - // In Railway, services cannot use simple hostnames to communicate - const backendUrl = process.env.BACKEND_URL || "https://tradinaagents-backend.up.railway.app"; - - return [ - { - source: "/api/:path*", - destination: `${backendUrl}/api/:path*`, - }, - ]; - }, -}; - -export default nextConfig; diff --git a/frontend/next.config.ts b/frontend/next.config.ts index fdbed71b..0069935d 100644 --- a/frontend/next.config.ts +++ b/frontend/next.config.ts @@ -4,9 +4,11 @@ const nextConfig: NextConfig = { output: 'standalone', reactCompiler: true, async rewrites() { - // Use BACKEND_URL env var, or fallback to public Railway URL - // In Railway, services cannot use simple hostnames to communicate - const backendUrl = process.env.BACKEND_URL || "https://tradinaagents-backend.up.railway.app"; + // In development: use localhost backend + // In production (Railway): use BACKEND_URL env var or fallback to Railway URL + const isDev = process.env.NODE_ENV === 'development'; + const backendUrl = process.env.BACKEND_URL || + (isDev ? "http://localhost:8000" : "https://tradinaagents-backend.up.railway.app"); return [ {