From abb2ac6780627a821dc5ccd87fc9a663e45e1c05 Mon Sep 17 00:00:00 2001 From: Nicholai Date: Thu, 5 Feb 2026 16:10:25 -0700 Subject: [PATCH] feat(agent): add AI chat and fix dashboard 500s (#35) * feat(agent): add AI chat panel and dashboard updates Add ElizaOS-powered agent chat panel with streaming, voice input, markdown rendering, and page-aware context. Update dashboard layout with context menu and refactored pages. Add agent memory schema, new UI components, and fix lint errors across AI-related files. * fix(auth): use Host header for SSO redirect URI nextUrl.origin returns http://localhost:3000 on CF Workers, breaking OAuth callbacks. Use Host header to derive the correct production origin for WorkOS redirect URI. * fix(auth): add Toaster to auth layout, fix error codes Auth pages had no Toaster component so toast.error() calls were invisible. Also return 401 for auth errors instead of generic 500 from the login API. * fix(dashboard): force-dynamic on all dashboard routes All dashboard routes use headers() via auth, causing static-to-dynamic runtime errors on CF Workers (500s). Add force-dynamic to layout and server component pages. --------- Co-authored-by: Nicholai --- src/app/dashboard/layout.tsx | 2 ++ src/app/dashboard/projects/[id]/page.tsx | 2 ++ src/app/dashboard/projects/[id]/schedule/page.tsx | 2 ++ src/app/dashboard/projects/page.tsx | 2 ++ 4 files changed, 8 insertions(+) diff --git a/src/app/dashboard/layout.tsx b/src/app/dashboard/layout.tsx index 1ed8854..e08b1f8 100755 --- a/src/app/dashboard/layout.tsx +++ b/src/app/dashboard/layout.tsx @@ -1,3 +1,5 @@ +export const dynamic = "force-dynamic" + import { AppSidebar } from "@/components/app-sidebar" import { SiteHeader } from "@/components/site-header" import { MobileBottomNav } from "@/components/mobile-bottom-nav" diff --git a/src/app/dashboard/projects/[id]/page.tsx b/src/app/dashboard/projects/[id]/page.tsx index f2a33da..6367c92 100755 --- a/src/app/dashboard/projects/[id]/page.tsx +++ b/src/app/dashboard/projects/[id]/page.tsx @@ -1,3 +1,5 @@ +export const dynamic = "force-dynamic" + import { getCloudflareContext } from "@opennextjs/cloudflare" import { getDb } from "@/db" import { projects, scheduleTasks } from "@/db/schema" diff --git a/src/app/dashboard/projects/[id]/schedule/page.tsx b/src/app/dashboard/projects/[id]/schedule/page.tsx index 12ff285..dc30809 100755 --- a/src/app/dashboard/projects/[id]/schedule/page.tsx +++ b/src/app/dashboard/projects/[id]/schedule/page.tsx @@ -1,3 +1,5 @@ +export const dynamic = "force-dynamic" + import { getCloudflareContext } from "@opennextjs/cloudflare" import { getDb } from "@/db" import { projects } from "@/db/schema" diff --git a/src/app/dashboard/projects/page.tsx b/src/app/dashboard/projects/page.tsx index 2ef16a5..e001cc4 100755 --- a/src/app/dashboard/projects/page.tsx +++ b/src/app/dashboard/projects/page.tsx @@ -1,3 +1,5 @@ +export const dynamic = "force-dynamic" + import { getCloudflareContext } from "@opennextjs/cloudflare" import { getDb } from "@/db" import { projects } from "@/db/schema"