File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -1217,7 +1217,12 @@ impl Session {
12171217
12181218 pub async fn interrupt_task ( self : & Arc < Self > ) {
12191219 info ! ( "interrupt received: abort current task, if any" ) ;
1220- self . abort_all_tasks ( TurnAbortReason :: Interrupted ) . await ;
1220+ let has_active_turn = { self . active_turn . lock ( ) . await . is_some ( ) } ;
1221+ if has_active_turn {
1222+ self . abort_all_tasks ( TurnAbortReason :: Interrupted ) . await ;
1223+ } else {
1224+ self . cancel_mcp_startup ( ) . await ;
1225+ }
12211226 }
12221227
12231228 pub ( crate ) fn notifier ( & self ) -> & UserNotifier {
Original file line number Diff line number Diff line change @@ -801,7 +801,7 @@ fn validate_mcp_server_name(server_name: &str) -> Result<()> {
801801 let re = regex_lite:: Regex :: new ( r"^[a-zA-Z0-9_-]+$" ) ?;
802802 if !re. is_match ( server_name) {
803803 return Err ( anyhow ! (
804- "invalid server name '{server_name}': must match pattern {pattern}" ,
804+ "Invalid MCP server name '{server_name}': must match pattern {pattern}" ,
805805 pattern = re. as_str( )
806806 ) ) ;
807807 }
You can’t perform that action at this time.
0 commit comments