File tree Expand file tree Collapse file tree 1 file changed +18
-6
lines changed
crates/chat-cli/src/api_client Expand file tree Collapse file tree 1 file changed +18
-6
lines changed Original file line number Diff line number Diff line change @@ -193,12 +193,19 @@ impl ApiClient {
193193 } ,
194194 }
195195
196- let profile = match database. get_auth_profile ( ) {
197- Ok ( profile) => profile,
198- Err ( err) => {
199- error ! ( "Failed to get auth profile: {err}" ) ;
200- None
201- } ,
196+ // Check if using custom endpoint
197+ let use_profile = !Self :: is_custom_endpoint ( database) ;
198+ let profile = if use_profile {
199+ match database. get_auth_profile ( ) {
200+ Ok ( profile) => profile,
201+ Err ( err) => {
202+ error ! ( "Failed to get auth profile: {err}" ) ;
203+ None
204+ } ,
205+ }
206+ } else {
207+ debug ! ( "Custom endpoint detected, skipping profile ARN" ) ;
208+ None
202209 } ;
203210
204211 Ok ( Self {
@@ -598,6 +605,11 @@ impl ApiClient {
598605
599606 self . mock_client = Some ( Arc :: new ( Mutex :: new ( mock. into_iter ( ) ) ) ) ;
600607 }
608+
609+ // Add a helper method to check if using non-default endpoint
610+ fn is_custom_endpoint ( database : & Database ) -> bool {
611+ database. settings . get ( Setting :: ApiCodeWhispererService ) . is_some ( )
612+ }
601613}
602614
603615fn timeout_config ( database : & Database ) -> TimeoutConfig {
You can’t perform that action at this time.
0 commit comments