File tree Expand file tree Collapse file tree
terminal/view/ambient_agent Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -83,13 +83,9 @@ impl HarnessAvailabilityModel {
8383 . unwrap_or_else ( || harness_display:: display_name ( harness) )
8484 }
8585
86- pub fn enabled_harness_count ( & self ) -> usize {
87- self . harnesses . iter ( ) . filter ( |h| h. enabled ) . count ( )
88- }
89-
90- /// Whether the harness selector should be shown (>1 enabled harness).
86+ /// Whether the harness selector should be shown (>1 known harness, including disabled).
9187 pub fn should_show_harness_selector ( & self ) -> bool {
92- FeatureFlag :: AgentHarness . is_enabled ( ) && self . enabled_harness_count ( ) > 1
88+ FeatureFlag :: AgentHarness . is_enabled ( ) && self . harnesses . len ( ) > 1
9389 }
9490
9591 /// Whether any harness is available at all (at least one enabled).
Original file line number Diff line number Diff line change @@ -125,6 +125,7 @@ impl HarnessSelector {
125125 & HarnessAvailabilityModel :: handle ( ctx) ,
126126 |me, _, _event, ctx| {
127127 me. refresh_menu ( ctx) ;
128+ me. refresh_button ( ctx) ;
128129 } ,
129130 ) ;
130131
@@ -268,7 +269,8 @@ fn build_menu_items(
268269 if is_disabled {
269270 fields = fields
270271 . with_disabled ( true )
271- . with_override_text_color ( disabled_text_color) ;
272+ . with_override_text_color ( disabled_text_color)
273+ . with_tooltip ( "Disabled by your administrator" ) ;
272274 }
273275 items. push ( MenuItem :: Item ( fields) ) ;
274276 }
Original file line number Diff line number Diff line change @@ -205,6 +205,20 @@ impl AmbientAgentViewModel {
205205
206206 let ui_state = AmbientAgentProgressUIState :: new ( ctx) ;
207207
208+ let harness = Harness :: default ( ) ;
209+ let availability = HarnessAvailabilityModel :: as_ref ( ctx) ;
210+ // If the default harness is not available, find the first available one.
211+ let harness = if !availability. is_harness_enabled ( harness) {
212+ availability
213+ . available_harnesses ( )
214+ . iter ( )
215+ . find ( |h| h. enabled )
216+ . map ( |h| h. harness )
217+ . unwrap_or ( harness)
218+ } else {
219+ harness
220+ } ;
221+
208222 Self {
209223 status : Status :: Composing ,
210224 request : None ,
@@ -215,7 +229,7 @@ impl AmbientAgentViewModel {
215229 setup_commands_state : Default :: default ( ) ,
216230 task_id : None ,
217231 conversation_id : None ,
218- harness : Harness :: default ( ) ,
232+ harness,
219233 worker_host : None ,
220234 harness_command_started : false ,
221235 active_execution_session_id : None ,
You can’t perform that action at this time.
0 commit comments