Hmbown/CodeWhale · error · anyhow::Error
Failed to update setting: invalid mode '{value}'. Expected:
Error message
Failed to update setting: invalid mode '{value}'. Expected: act (agent), plan, or operate. What it means
Settings update validation for the default-mode key: the value (with aliases like agent→act, ops→operate normalized) still matched no supported mode. Modes map to the engine's authority posture, so an unknown mode cannot be stored.
Source
Thrown at crates/tui/src/settings.rs:1422
let normalized = normalize_synchronized_output(value);
if !["auto", "on", "off"].contains(&normalized) {
anyhow::bail!(
"Failed to update setting: invalid synchronized_output '{value}'. Expected: auto, on, off."
);
}
self.synchronized_output = normalized.to_string();
}
"workspace_follow_symlinks" | "follow_symlinks" => {
self.workspace_follow_symlinks = parse_bool(value)?;
}
"default_mode" | "mode" => {
// Act (wire: agent), Plan, and Operate are valid startup modes.
// yolo remains a permission-migration alias, not a mode write.
self.default_mode = match value.trim().to_ascii_lowercase().as_str() {
"agent" | "normal" | "act" | "work" | "edit" => "agent".to_string(),
"plan" => "plan".to_string(),
"operate" | "operation" | "ops" => "operate".to_string(),
_ => anyhow::bail!(
"Failed to update setting: invalid mode '{value}'. Expected: act (agent), plan, or operate."
),
};
}
"context_panel" | "context" | "session_panel" => {
self.context_panel = parse_bool(value)?;
}
"sessions_rail" | "sessions_panel" | "session_rail" => {
self.sessions_rail = parse_bool(value)?;
}
"session_auto_resume" | "auto_resume" => {
self.session_auto_resume = parse_bool(value)?;
}
"cost_currency" | "currency" => {
let Some(currency) = crate::pricing::CostCurrency::from_setting(value) else {
anyhow::bail!(
"Failed to update setting: invalid cost currency '{value}'. Expected: usd, cny, rmb, yuan."
);View on GitHub (pinned to 0c42157ee5)
Solutions
- Set the mode to act, plan, or operate
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at crates/tui/src/settings.rs:1422 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of Hmbown/CodeWhale@0c42157ee5 (2026-08-20).
Data as JSON: /api/errors/c09d9a554f71397f.
Report an issue: GitHub.