@@ -25,6 +25,8 @@ import {
2525} from '@/common/components/ui/dropdown-menu'
2626import { cn } from '@/common/lib/utils'
2727import { useConfirm } from '@/common/hooks/use-confirm'
28+ import { useFeatureFlag } from '@/common/hooks/use-feature-flag'
29+ import { featureFlagKeys } from '@utils/feature-flags'
2830import type { PlaygroundThread } from '../hooks/use-playground-threads'
2931
3032interface PlaygroundSidebarProps {
@@ -268,8 +270,10 @@ export function PlaygroundSidebar({
268270 const starredThreads = threads . filter ( ( t ) => t . starred )
269271 const recentThreads = threads . filter ( ( t ) => ! t . starred )
270272 const hasStarred = starredThreads . length > 0
273+ const isAgentsEnabled = useFeatureFlag ( featureFlagKeys . AGENTS )
271274 const pathname = useRouterState ( { select : ( s ) => s . location . pathname } )
272- const isAgentsActive = pathname . startsWith ( '/playground/agents' )
275+ const isAgentsActive =
276+ isAgentsEnabled && pathname . startsWith ( '/playground/agents' )
273277
274278 const renderItem = ( thread : PlaygroundThread ) => (
275279 < ThreadItem
@@ -289,20 +293,23 @@ export function PlaygroundSidebar({
289293 shrink-0 flex-col border-r"
290294 >
291295 < div className = "flex flex-col gap-0.5 px-2 pt-2 pb-1" >
292- < Link
293- to = "/playground/agents"
294- aria-label = "Agents"
295- className = { cn (
296- 'flex w-full items-center gap-2 rounded-md px-2 py-1 text-sm' ,
297- 'transition-colors' ,
298- isAgentsActive
299- ? 'bg-accent text-accent-foreground'
300- : 'text-muted-foreground hover:text-foreground hover:bg-accent/60'
301- ) }
302- >
303- < Bot className = "h-4 w-4 shrink-0" />
304- Agents
305- </ Link >
296+ { isAgentsEnabled && (
297+ < Link
298+ to = "/playground/agents"
299+ aria-label = "Agents"
300+ className = { cn (
301+ 'flex w-full items-center gap-2 rounded-md px-2 py-1 text-sm' ,
302+ 'transition-colors' ,
303+ isAgentsActive
304+ ? 'bg-accent text-accent-foreground'
305+ : `text-muted-foreground hover:text-foreground
306+ hover:bg-accent/60`
307+ ) }
308+ >
309+ < Bot className = "h-4 w-4 shrink-0" />
310+ Agents
311+ </ Link >
312+ ) }
306313 < button
307314 type = "button"
308315 onClick = { onCreateThread }
0 commit comments