@@ -2,6 +2,8 @@ import { ArrowPathIcon } from "@heroicons/react/24/outline";
22import { useContext , useEffect , useState } from "react" ;
33import { useAuth } from "../../context/Auth" ;
44import { IdeMessengerContext } from "../../context/IdeMessenger" ;
5+ import { useAppSelector } from "../../redux/hooks" ;
6+ import { selectCurrentOrg } from "../../redux/slices/profilesSlice" ;
57
68interface Agent {
79 id : string ;
@@ -17,6 +19,7 @@ interface Agent {
1719export function AgentsList ( ) {
1820 const { session } = useAuth ( ) ;
1921 const ideMessenger = useContext ( IdeMessengerContext ) ;
22+ const currentOrg = useAppSelector ( selectCurrentOrg ) ;
2023 const [ agents , setAgents ] = useState < Agent [ ] > ( [ ] ) ;
2124 const [ isLoading , setIsLoading ] = useState ( true ) ;
2225 const [ error , setError ] = useState < string | null > ( null ) ;
@@ -32,7 +35,10 @@ export function AgentsList() {
3235 try {
3336 setIsLoading ( true ) ;
3437 // Request agent list from IDE
35- const result = await ideMessenger . request ( "listBackgroundAgents" , { } ) ;
38+ const organizationId = currentOrg ?. id ;
39+ const result = await ideMessenger . request ( "listBackgroundAgents" , {
40+ organizationId,
41+ } ) ;
3642
3743 if ( result && Array . isArray ( result ) ) {
3844 setAgents ( result ) ;
@@ -57,7 +63,7 @@ export function AgentsList() {
5763 } , 10000 ) ;
5864
5965 return ( ) => clearInterval ( interval ) ;
60- } , [ session , ideMessenger ] ) ;
66+ } , [ session , ideMessenger , currentOrg ] ) ;
6167
6268 if ( isLoading ) {
6369 return (
0 commit comments