feat: Add validation for reasoning_effort settings to prevent users from specifying erroneous values

This commit is contained in:
2026-07-16 13:12:11 -06:00
parent 5843a9ac15
commit 0f7877aafc
2 changed files with 67 additions and 1 deletions
+2
View File
@@ -31,6 +31,7 @@ impl Completer for ReplCompleter {
let ctx = self.ctx.read();
let state = ctx.state();
let model_has_reasoning = !ctx.current_model().reasoning_levels().is_empty();
let command_filter = parts
.iter()
@@ -44,6 +45,7 @@ impl Completer for ReplCompleter {
.filter(|cmd| {
cmd.is_valid(state)
&& (command_filter.len() == 1 || cmd.name.starts_with(&command_filter[..2]))
&& (cmd.name != ".reasoning" || model_has_reasoning)
})
.collect();
let commands = fuzzy_filter(commands, |v| v.name, &command_filter);