diff --git a/crates/assistant/src/slash_command/context_server_command.rs b/crates/assistant/src/slash_command/context_server_command.rs index 027a6baf2b..8ae9430a99 100644 --- a/crates/assistant/src/slash_command/context_server_command.rs +++ b/crates/assistant/src/slash_command/context_server_command.rs @@ -44,10 +44,9 @@ impl SlashCommand for ContextServerSlashCommand { } fn requires_argument(&self) -> bool { - self.prompt - .arguments - .as_ref() - .map_or(false, |args| !args.is_empty()) + self.prompt.arguments.as_ref().map_or(false, |args| { + args.iter().any(|arg| arg.required == Some(true)) + }) } fn complete_argument( @@ -179,6 +178,8 @@ fn prompt_arguments(prompt: &PromptInfo, arguments: &[String]) -> Result Result bool { match &prompt.arguments { None => true, - Some(args) if args.len() == 1 => true, + Some(args) if args.len() <= 1 => true, _ => false, } }