@@ -46,7 +46,7 @@ export const RESOURCE_ALLOCATION_INITIAL_FORM_VALUES: DeepPartial<ResourceAlloca
4646 cluster_mode : 'single-node' ,
4747 cluster_size : 1 ,
4848 enabledAutomaticShmem : true ,
49- agent : 'auto' ,
49+ agent : [ 'auto' ] ,
5050 } ;
5151
5252export const isMinOversMaxValue = ( min : number , max : number ) => {
@@ -67,7 +67,7 @@ export interface ResourceAllocationFormValue {
6767 cluster_size : number ;
6868 enabledAutomaticShmem : boolean ;
6969 allocationPreset ?: string ;
70- agent ?: string ;
70+ agent ?: string [ ] | string ;
7171}
7272
7373export type MergedResourceAllocationFormValue = ResourceAllocationFormValue &
@@ -1233,14 +1233,26 @@ const ResourceAllocationFormItems: React.FC<
12331233 < AgentSelect
12341234 resourceGroup = { currentResourceGroupInForm }
12351235 fetchKey = { agentFetchKey }
1236+ mode = {
1237+ baiClient . supports ( 'multi-agents' ) ? 'multiple' : undefined
1238+ }
1239+ labelRender = {
1240+ baiClient . supports ( 'multi-agents' )
1241+ ? ( { label, value } ) => {
1242+ return value === 'auto' ? label : value ;
1243+ }
1244+ : undefined
1245+ }
12361246 onChange = { ( value ) => {
1237- if ( value !== 'auto' ) {
1247+ if (
1248+ ! baiClient . supports ( 'multi-agents' ) &&
1249+ ! _ . isEqual ( _ . castArray ( value ) , [ 'auto' ] )
1250+ ) {
12381251 form . setFieldsValue ( {
12391252 cluster_mode : 'single-node' ,
12401253 cluster_size : 1 ,
12411254 } ) ;
12421255 }
1243- // TODO: set cluster mode to single node and cluster size to 1 when agent value is not "auto"
12441256 } }
12451257 > </ AgentSelect >
12461258 </ Form . Item >
@@ -1286,7 +1298,12 @@ const ResourceAllocationFormItems: React.FC<
12861298 onChange = { ( ) => {
12871299 form . validateFields ( ) . catch ( ( ) => { } ) ;
12881300 } }
1289- disabled = { getFieldValue ( 'agent' ) !== 'auto' }
1301+ disabled = {
1302+ ! baiClient . supports ( 'multi-agents' ) &&
1303+ ! _ . isEqual ( _ . castArray ( getFieldValue ( 'agent' ) ) , [
1304+ 'auto' ,
1305+ ] )
1306+ }
12901307 >
12911308 < Radio . Button value = "single-node" >
12921309 { t ( 'session.launcher.SingleNode' ) }
@@ -1351,7 +1368,11 @@ const ResourceAllocationFormItems: React.FC<
13511368 }
13521369 disabled = {
13531370 derivedClusterSizeMaxLimit === 1 ||
1354- getFieldValue ( 'agent' ) !== 'auto'
1371+ ( ! baiClient . supports ( 'multi-agents' ) &&
1372+ ! _ . isEqual (
1373+ _ . castArray ( getFieldValue ( 'agent' ) ) ,
1374+ [ 'auto' ] ,
1375+ ) )
13551376 }
13561377 sliderProps = { {
13571378 marks : {
0 commit comments