Skip to content

Commit 00705e2

Browse files
fix: use runtime env vars instead of NEXT_PUBLIC_ build-time vars
NEXT_PUBLIC_* env vars are statically replaced at build time by the Next.js compiler, even in server components. Since these variables are only read in server components (and passed as props to client components), they don't need the NEXT_PUBLIC_ prefix. Renamed to KAGENT_UI_HEADLINE and KAGENT_UI_SUBTITLE so they are read from process.env at request time, making them truly configurable without rebuilding the Docker image. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Optimus (AI Agent) <agent@fulcria.com>
1 parent 7dce822 commit 00705e2

4 files changed

Lines changed: 4 additions & 4 deletions

File tree

ui/src/app/agents/[namespace]/[name]/chat/[chatId]/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ export default async function ChatPageView({ params }: { params: Promise<{ name:
99
selectedAgentName={name}
1010
selectedNamespace={namespace}
1111
sessionId={chatId}
12-
headline={process.env.NEXT_PUBLIC_HEADLINE}
12+
headline={process.env.KAGENT_UI_HEADLINE}
1313
/>;
1414
}

ui/src/app/agents/[namespace]/[name]/chat/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ export const dynamic = "force-dynamic";
55
// This page component receives props (like params) from the Layout
66
export default async function ChatAgentPage({ params }: { params: Promise<{ name: string, namespace: string }> }) {
77
const { name, namespace } = await params;
8-
const headline = process.env.NEXT_PUBLIC_HEADLINE;
8+
const headline = process.env.KAGENT_UI_HEADLINE;
99
return <ChatInterface selectedAgentName={name} selectedNamespace={namespace} headline={headline} />;
1010
}

ui/src/app/agents/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ import AgentList from "@/components/AgentList";
33
export const dynamic = "force-dynamic";
44

55
export default async function AgentListPage() {
6-
const subtitle = process.env.NEXT_PUBLIC_SUBTITLE;
6+
const subtitle = process.env.KAGENT_UI_SUBTITLE;
77
return <AgentList subtitle={subtitle} />;
88
}

ui/src/app/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ import AgentList from "@/components/AgentList";
33
export const dynamic = "force-dynamic";
44

55
export default async function AgentListPage() {
6-
const subtitle = process.env.NEXT_PUBLIC_SUBTITLE;
6+
const subtitle = process.env.KAGENT_UI_SUBTITLE;
77
return <AgentList subtitle={subtitle} />;
88
}

0 commit comments

Comments
 (0)