@@ -33,9 +33,23 @@ function formatParams(params?: Record<string, unknown> | null): string {
3333
3434export default function TargetBadge ( { target } : TargetBadgeProps ) {
3535 const styles = useTargetBadgeStyles ( )
36- const displayName = target . model_name
37- ? `${ target . target_type } (${ target . model_name } )`
38- : target . target_type
36+ const innerTargets = target . inner_targets ?? [ ]
37+ const isRoundRobin = innerTargets . length > 0
38+
39+ // For RoundRobinTarget, prefer underlying_model_name because inner targets share
40+ // the same underlying model but may have different deployment names (model_name).
41+ // For regular targets, use model_name as before.
42+ const badgeModel = isRoundRobin
43+ ? ( target . underlying_model_name ?? target . model_name )
44+ : target . model_name
45+ const displayName = isRoundRobin
46+ ? badgeModel
47+ ? `${ target . target_type } (${ badgeModel } ×${ innerTargets . length } )`
48+ : `${ target . target_type } (×${ innerTargets . length } )`
49+ : target . model_name
50+ ? `${ target . target_type } (${ target . model_name } )`
51+ : target . target_type
52+
3953 const showUnderlying =
4054 target . underlying_model_name &&
4155 target . model_name &&
@@ -47,6 +61,9 @@ export default function TargetBadge({ target }: TargetBadgeProps) {
4761 const outputModalities = target . capabilities ?. supported_output_modalities ?? [ ]
4862 const params = formatParams ( target . target_specific_params )
4963
64+ // Extract weights from params so we can show them next to each inner target
65+ const weights = target . target_specific_params ?. weights as number [ ] | undefined
66+
5067 const tooltipContent = (
5168 < div className = { styles . tooltipBody } >
5269 < div className = { styles . tooltipHeader } >
@@ -91,6 +108,28 @@ export default function TargetBadge({ target }: TargetBadgeProps) {
91108 </ div >
92109 </ div >
93110 ) }
111+ { /* Inner targets section — only shown for composite targets like RoundRobinTarget */ }
112+ { isRoundRobin && (
113+ < div className = { styles . tooltipSection } >
114+ < span className = { styles . sectionLabel } > Inner Targets ({ innerTargets . length } )</ span >
115+ { innerTargets . map ( ( inner , idx ) => (
116+ < div key = { inner . target_registry_name } className = { styles . innerTargetItem } >
117+ < Text size = { 200 } weight = "semibold" >
118+ #{ idx + 1 } { weights ?. [ idx ] != null ? ` (weight: ${ weights [ idx ] } )` : '' }
119+ </ Text >
120+ < Text size = { 200 } >
121+ { inner . target_type }
122+ { inner . model_name ? ` — ${ inner . model_name } ` : '' }
123+ </ Text >
124+ { inner . endpoint && (
125+ < Text className = { styles . endpointText } size = { 200 } >
126+ { inner . endpoint }
127+ </ Text >
128+ ) }
129+ </ div >
130+ ) ) }
131+ </ div >
132+ ) }
94133 { params && (
95134 < div className = { styles . tooltipSection } >
96135 < span className = { styles . sectionLabel } > Parameters</ span >
0 commit comments