@@ -191,7 +191,7 @@ pub struct ChatArgs {
191
191
/// Context profile to use
192
192
#[ arg( long = "profile" ) ]
193
193
pub profile : Option < String > ,
194
- /// Current model to use
194
+ /// Current model to use
195
195
#[ arg( long = "model" ) ]
196
196
pub model : Option < String > ,
197
197
/// Allows the model to use any tool to run commands without asking for confirmation.
@@ -278,51 +278,27 @@ impl ChatArgs {
278
278
}
279
279
}
280
280
281
- // If modelId is specified, verify it exists before starting the chat
282
- let model_id: Option < String > = if let Some ( model_name) = model_name {
283
- let model_name_lower = model_name. to_lowercase ( ) ;
284
- match MODEL_OPTIONS . iter ( ) . find ( |( _, name, _) | name == & model_name_lower) {
285
- Some ( ( _, _, id) ) => Some ( id. to_string ( ) ) ,
286
- None => {
287
- let available_names: Vec < & str > = MODEL_OPTIONS . iter ( ) . map ( |( _, name, _) | * name) . collect ( ) ;
288
- bail ! (
289
- "Model '{}' does not exist. Available models: {}" ,
290
- model_name,
291
- available_names. join( ", " )
292
- ) ;
293
- } ,
294
- }
295
- } else {
296
- None
297
- } ;
281
+ // If modelId is specified, verify it exists before starting the chat
282
+ let model_id: Option < String > = if let Some ( model_name) = model_name {
283
+ let model_name_lower = model_name. to_lowercase ( ) ;
284
+ match MODEL_OPTIONS . iter ( ) . find ( |( _, name, _) | name == & model_name_lower) {
285
+ Some ( ( _, _, id) ) => Some ( id. to_string ( ) ) ,
286
+ None => {
287
+ let available_names: Vec < & str > = MODEL_OPTIONS . iter ( ) . map ( |( _, name, _) | * name) . collect ( ) ;
288
+ bail ! (
289
+ "Model '{}' does not exist. Available models: {}" ,
290
+ model_name,
291
+ available_names. join( ", " )
292
+ ) ;
293
+ } ,
294
+ }
295
+ } else {
296
+ None
297
+ } ;
298
298
299
- // if let Some(ref id) = model_id {
300
- // database.set_last_used_model_id(id.clone())?;
301
- // }
302
- let conversation_id = Alphanumeric . sample_string ( & mut rand:: rng ( ) , 9 ) ;
303
- info ! ( ?conversation_id, "Generated new conversation id" ) ;
304
- let ( prompt_request_sender, prompt_request_receiver) = std:: sync:: mpsc:: channel :: < Option < String > > ( ) ;
305
- let ( prompt_response_sender, prompt_response_receiver) = std:: sync:: mpsc:: channel :: < Vec < String > > ( ) ;
306
- let tool_manager_output: Box < dyn Write + Send + Sync + ' static > = if interactive {
307
- Box :: new ( output. clone ( ) )
308
- } else {
309
- Box :: new ( NullWriter { } )
310
- } ;
311
- let mut tool_manager = ToolManagerBuilder :: default ( )
312
- . mcp_server_config ( mcp_server_configs)
313
- . prompt_list_sender ( prompt_response_sender)
314
- . prompt_list_receiver ( prompt_request_receiver)
315
- . conversation_id ( & conversation_id)
316
- . interactive ( interactive)
317
- . build ( telemetry, tool_manager_output)
318
- . await ?;
319
- let tool_config = tool_manager. load_tools ( database, & mut output) . await ?;
320
- let mut tool_permissions = ToolPermissions :: new ( tool_config. len ( ) ) ;
321
- if accept_all || trust_all_tools {
322
- tool_permissions. trust_all = true ;
323
- for tool in tool_config. values ( ) {
324
- tool_permissions. trust_tool ( & tool. name ) ;
325
- }
299
+ // if let Some(ref id) = model_id {
300
+ // database.set_last_used_model_id(id.clone())?;
301
+ // }
326
302
let conversation_id = Alphanumeric . sample_string ( & mut rand:: rng ( ) , 9 ) ;
327
303
info ! ( ?conversation_id, "Generated new conversation id" ) ;
328
304
let ( prompt_request_sender, prompt_request_receiver) = std:: sync:: mpsc:: channel :: < Option < String > > ( ) ;
0 commit comments