Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions ui/src/app/agents/[namespace]/[name]/chat/[chatId]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
"use client";
import { use } from "react";
import ChatInterface from "@/components/chat/ChatInterface";

export default function ChatPageView({ params }: { params: Promise<{ name: string; namespace: string; chatId: string }> }) {
const { name, namespace, chatId } = use(params);
export const dynamic = "force-dynamic";

export default async function ChatPageView({ params }: { params: Promise<{ name: string; namespace: string; chatId: string }> }) {
const { name, namespace, chatId } = await params;
const headline = process.env.NEXT_PUBLIC_HEADLINE;

return <ChatInterface
selectedAgentName={name}
selectedNamespace={namespace}
sessionId={chatId}
headline={headline}
/>;
}
7 changes: 5 additions & 2 deletions ui/src/app/agents/[namespace]/[name]/chat/page.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import ChatInterface from "@/components/chat/ChatInterface";
import { use } from 'react';

export const dynamic = "force-dynamic";

// This page component receives props (like params) from the Layout
export default function ChatAgentPage({ params }: { params: Promise<{ name: string, namespace: string }> }) {
const { name, namespace } = use(params);
return <ChatInterface selectedAgentName={name} selectedNamespace={namespace} />;
}
const headline = process.env.NEXT_PUBLIC_HEADLINE;
return <ChatInterface selectedAgentName={name} selectedNamespace={namespace} headline={headline} />;
Comment on lines 7 to 10
Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NEXT_PUBLIC_ environment variables are inlined at build time by default in Next.js. To ensure the headline can be changed at runtime without rebuilding (as described in the issue #1345), you need to add export const dynamic = "force-dynamic"; before the component function. This forces the page to be dynamically rendered, allowing the env var to be read at runtime from the deployment environment.

Copilot uses AI. Check for mistakes.
}
6 changes: 5 additions & 1 deletion ui/src/app/agents/page.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import AgentList from "@/components/AgentList";
Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NEXT_PUBLIC_ environment variables are inlined at build time by default in Next.js. To ensure the subtitle can be changed at runtime without rebuilding (as described in the issue #1345), you need to add export const dynamic = "force-dynamic"; before the component function. This forces the page to be dynamically rendered, allowing the env var to be read at runtime from the deployment environment.

Suggested change
import AgentList from "@/components/AgentList";
import AgentList from "@/components/AgentList";
export const dynamic = "force-dynamic";

Copilot uses AI. Check for mistakes.

export const dynamic = "force-dynamic";

export default function AgentListPage() {
return <AgentList />;
const subtitle = process.env.NEXT_PUBLIC_SUBTITLE;
return <AgentList subtitle={subtitle} />;
}
5 changes: 4 additions & 1 deletion ui/src/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import AgentList from "@/components/AgentList";

Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NEXT_PUBLIC_ environment variables are inlined at build time by default in Next.js. To ensure the subtitle can be changed at runtime without rebuilding (as described in the issue #1345), you need to add export const dynamic = "force-dynamic"; before the component function. This forces the page to be dynamically rendered, allowing the env var to be read at runtime from the deployment environment.

Suggested change
export const dynamic = "force-dynamic";

Copilot uses AI. Check for mistakes.
export const dynamic = "force-dynamic";

export default async function AgentListPage() {
return <AgentList />;
const subtitle = process.env.NEXT_PUBLIC_SUBTITLE;
return <AgentList subtitle={subtitle} />;
}
11 changes: 9 additions & 2 deletions ui/src/components/AgentList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ import { Button } from "./ui/button";
import { LoadingState } from "./LoadingState";
import { useAgents } from "./AgentsProvider";

export default function AgentList() {
interface AgentListProps {
subtitle?: string;
}

export default function AgentList({ subtitle }: AgentListProps) {
const { agents , loading, error } = useAgents();

if (error) {
Expand All @@ -23,7 +27,10 @@ export default function AgentList() {
<div className="mt-12 mx-auto max-w-6xl px-6">
<div className="flex justify-between items-center mb-8">
<div className="flex items-center gap-4">
<h1 className="text-2xl font-bold">Agents</h1>
<div>
<h1 className="text-2xl font-bold">Agents</h1>
{subtitle && <p className="text-muted-foreground text-sm mt-1">{subtitle}</p>}
</div>
</div>
</div>

Expand Down
5 changes: 3 additions & 2 deletions ui/src/components/chat/ChatInterface.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,10 @@ interface ChatInterfaceProps {
selectedNamespace: string;
selectedSession?: Session | null;
sessionId?: string;
headline?: string;
}

export default function ChatInterface({ selectedAgentName, selectedNamespace, selectedSession, sessionId }: ChatInterfaceProps) {
export default function ChatInterface({ selectedAgentName, selectedNamespace, selectedSession, sessionId, headline }: ChatInterfaceProps) {
const router = useRouter();
const containerRef = useRef<HTMLDivElement>(null);
const [currentInputMessage, setCurrentInputMessage] = useState("");
Expand Down Expand Up @@ -379,7 +380,7 @@ export default function ChatInterface({ selectedAgentName, selectedNamespace, se
) : storedMessages.length === 0 && streamingMessages.length === 0 && !isStreaming ? (
<div className="flex items-center justify-center h-full min-h-[50vh]">
<div className="bg-card p-6 rounded-lg shadow-sm border max-w-md text-center">
<h3 className="text-lg font-medium mb-2">Start a conversation</h3>
<h3 className="text-lg font-medium mb-2">{headline || "Start a conversation"}</h3>
<p className="text-muted-foreground">
To begin chatting with the agent, type your message in the input box below.
</p>
Expand Down
Loading