File tree Expand file tree Collapse file tree
components/dialogs/settings-tabs Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import { useState , useEffect } from "react"
2+ import { useAtomValue } from "jotai"
23import { ChevronRight } from "lucide-react"
34import { motion , AnimatePresence } from "motion/react"
5+ import { selectedProjectAtom } from "../../../features/agents/atoms"
46import { trpc } from "../../../lib/trpc"
57import { cn } from "../../../lib/utils"
68import { AgentIcon } from "../../ui/icons"
@@ -36,8 +38,11 @@ interface FileAgent {
3638export function AgentsCustomAgentsTab ( ) {
3739 const isNarrowScreen = useIsNarrowScreen ( )
3840 const [ expandedAgentName , setExpandedAgentName ] = useState < string | null > ( null )
41+ const selectedProject = useAtomValue ( selectedProjectAtom )
3942
40- const { data : agents = [ ] , isLoading } = trpc . agents . list . useQuery ( undefined )
43+ const { data : agents = [ ] , isLoading } = trpc . agents . list . useQuery (
44+ selectedProject ?. path ? { cwd : selectedProject . path } : undefined ,
45+ )
4146
4247 const openInFinderMutation = trpc . external . openInFinder . useMutation ( )
4348
Original file line number Diff line number Diff line change 11import { useState , useEffect } from "react"
2+ import { useAtomValue } from "jotai"
23import { ChevronRight } from "lucide-react"
34import { motion , AnimatePresence } from "motion/react"
5+ import { selectedProjectAtom } from "../../../features/agents/atoms"
46import { trpc } from "../../../lib/trpc"
57import { cn } from "../../../lib/utils"
68import { SkillIcon } from "../../ui/icons"
@@ -25,8 +27,11 @@ function useIsNarrowScreen(): boolean {
2527export function AgentsSkillsTab ( ) {
2628 const isNarrowScreen = useIsNarrowScreen ( )
2729 const [ expandedSkillName , setExpandedSkillName ] = useState < string | null > ( null )
30+ const selectedProject = useAtomValue ( selectedProjectAtom )
2831
29- const { data : skills = [ ] , isLoading } = trpc . skills . list . useQuery ( undefined )
32+ const { data : skills = [ ] , isLoading } = trpc . skills . list . useQuery (
33+ selectedProject ?. path ? { cwd : selectedProject . path } : undefined ,
34+ )
3035 const openInFinderMutation = trpc . external . openInFinder . useMutation ( )
3136
3237 const userSkills = skills . filter ( ( s ) => s . source === "user" )
Original file line number Diff line number Diff line change @@ -695,16 +695,22 @@ export const AgentsFileMention = memo(function AgentsFileMention({
695695 const sessionInfo = useAtomValue ( sessionInfoAtom )
696696
697697 // Fetch skills from filesystem (cached for 5 minutes)
698- const { data : skills = [ ] , isFetching : isFetchingSkills } = trpc . skills . listEnabled . useQuery ( undefined , {
699- enabled : isOpen ,
700- staleTime : 5 * 60 * 1000 , // 5 minutes - skills don't change frequently
701- } )
698+ const { data : skills = [ ] , isFetching : isFetchingSkills } = trpc . skills . listEnabled . useQuery (
699+ projectPath ? { cwd : projectPath } : undefined ,
700+ {
701+ enabled : isOpen ,
702+ staleTime : 5 * 60 * 1000 , // 5 minutes - skills don't change frequently
703+ } ,
704+ )
702705
703706 // Fetch custom agents from filesystem (cached for 5 minutes)
704- const { data : customAgents = [ ] , isFetching : isFetchingAgents } = trpc . agents . listEnabled . useQuery ( undefined , {
705- enabled : isOpen ,
706- staleTime : 5 * 60 * 1000 , // 5 minutes - agents don't change frequently
707- } )
707+ const { data : customAgents = [ ] , isFetching : isFetchingAgents } = trpc . agents . listEnabled . useQuery (
708+ projectPath ? { cwd : projectPath } : undefined ,
709+ {
710+ enabled : isOpen ,
711+ staleTime : 5 * 60 * 1000 , // 5 minutes - agents don't change frequently
712+ } ,
713+ )
708714
709715 // Debounce search text (300ms to match canvas implementation)
710716 useEffect ( ( ) => {
You can’t perform that action at this time.
0 commit comments