feat: expose effort level setting in UI (#269)

Adds `--effort <level>` CLI flag support with a dropdown selector in the config sidebar. Valid options are low, medium, high, xhigh (Opus 4.7 only), and max.
This commit is contained in:
2026-05-06 13:37:13 -07:00
committed by Naomi Carrigan
parent bbbddaceaa
commit 3f57937d54
12 changed files with 67 additions and 0 deletions
+12
View File
@@ -70,6 +70,11 @@ pub struct ClaudeStartOptions {
/// Sets `ANTHROPIC_CUSTOM_MODEL_OPTION` env var for custom model providers (v2.1.81+).
#[serde(default)]
pub custom_model_option: Option<String>,
/// Passes `--effort <level>` to set the effort level (v2.1.111+).
/// Valid values: "low", "medium", "high", "xhigh" (Opus 4.7 only), "max". None uses CLI default.
#[serde(default)]
pub effort_level: Option<String>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
@@ -236,6 +241,11 @@ pub struct HikariConfig {
/// Sets `ANTHROPIC_CUSTOM_MODEL_OPTION` env var for custom model providers (v2.1.81+).
#[serde(default)]
pub custom_model_option: Option<String>,
/// Passes `--effort <level>` to set the effort level (v2.1.111+).
/// Valid values: "low", "medium", "high", "xhigh" (Opus 4.7 only), "max". None uses CLI default.
#[serde(default)]
pub effort_level: Option<String>,
}
impl Default for HikariConfig {
@@ -291,6 +301,7 @@ impl Default for HikariConfig {
bare_mode: false,
show_clear_context_on_plan_accept: true,
custom_model_option: None,
effort_level: None,
}
}
}
@@ -508,6 +519,7 @@ mod tests {
bare_mode: false,
show_clear_context_on_plan_accept: true,
custom_model_option: None,
effort_level: None,
};
let json = serde_json::to_string(&config).unwrap();
+15
View File
@@ -308,6 +308,14 @@ impl WslBridge {
cmd.arg("--bare");
}
// Add effort level if specified (v2.1.111+)
if let Some(ref level) = options.effort_level {
if !level.is_empty() {
cmd.arg("--effort");
cmd.arg(level);
}
}
// Pass combined settings via --settings flag if any settings are specified
{
let has_memory_dir = options
@@ -532,6 +540,13 @@ impl WslBridge {
claude_cmd.push_str(" --bare");
}
// Add effort level if specified (v2.1.111+)
if let Some(ref level) = options.effort_level {
if !level.is_empty() {
claude_cmd.push_str(&format!(" --effort {}", level));
}
}
// Pass combined settings via --settings flag if any settings are specified
{
let has_memory_dir = options