Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion rust/crates/runtime/src/hooks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -737,7 +737,7 @@ fn format_hook_failure(command: &str, code: i32, stdout: Option<&str>, stderr: &

fn shell_command(command: &str) -> CommandWithStdin {
#[cfg(windows)]
let mut command_builder = {
let command_builder = {
let mut command_builder = Command::new("cmd");
command_builder.arg("/C").arg(command);
CommandWithStdin::new(command_builder)
Expand Down
37 changes: 16 additions & 21 deletions rust/crates/rusty-claude-cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,12 @@ const DEFAULT_MODEL: &str = "anthropic/claude-opus-4-6";
enum ModelSource {
/// Explicit `--model` / `--model=` CLI flag.
Flag,
/// ANTHROPIC_MODEL environment variable (when no flag was passed).
/// `ANTHROPIC_MODEL` environment variable (when no flag was passed).
Env,
/// `model` key in `.claw.json` / `.claw/settings.json` (when neither
/// flag nor env set it).
Config,
/// Compiled-in DEFAULT_MODEL fallback.
/// Compiled-in `DEFAULT_MODEL` fallback.
Default,
}

Expand Down Expand Up @@ -261,7 +261,7 @@ Run `claw --help` for usage."

/// #77: Classify a stringified error message into a machine-readable kind.
///
/// Returns a snake_case token that downstream consumers can switch on instead
/// Returns a `snake_case` token that downstream consumers can switch on instead
/// of regex-scraping the prose. The classification is best-effort prefix/keyword
/// matching against the error messages produced throughout the CLI surface.
fn classify_error_kind(message: &str) -> &'static str {
Expand Down Expand Up @@ -321,9 +321,9 @@ fn classify_error_kind(message: &str) -> &'static str {
}
}

/// #77: Split a multi-line error message into (short_reason, optional_hint).
/// #77: Split a multi-line error message into (`short_reason`, `optional_hint`).
///
/// The short_reason is the first line (up to the first newline), and the hint
/// The `short_reason` is the first line (up to the first newline), and the hint
/// is the remaining text or `None` if there's no newline. This prevents the
/// runbook prose from being stuffed into the `error` field that downstream
/// parsers expect to be the short reason alone.
Expand Down Expand Up @@ -4317,14 +4317,12 @@ fn run_resume_command(
}
SlashCommand::Plugins { action, target } => {
// Only list is supported in resume mode (no runtime to reload)
match action.as_deref() {
Some("install") | Some("uninstall") | Some("enable") | Some("disable")
| Some("update") => {
return Err(
"resumed /plugins mutations are interactive-only; start `claw` and run `/plugins` in the REPL".into(),
);
}
_ => {}
if let Some("install" | "uninstall" | "enable" | "disable" | "update") =
action.as_deref()
{
return Err(
"resumed /plugins mutations are interactive-only; start `claw` and run `/plugins` in the REPL".into(),
);
}
let cwd = env::current_dir()?;
let payload = plugins_command_payload_for(&cwd, action.as_deref(), target.as_deref())?;
Expand Down Expand Up @@ -6033,8 +6031,8 @@ impl LiveCli {
// Propagate ok:false → non-zero exit so automation callers
// can rely on exit code instead of inspecting the envelope.
// (#68: mcp error envelopes previously always exited 0.)
let is_error = value.get("ok").and_then(|v| v.as_bool()) == Some(false)
|| value.get("status").and_then(|v| v.as_str()) == Some("error");
let is_error = value.get("ok").and_then(serde_json::Value::as_bool) == Some(false)
|| value.get("status").and_then(serde_json::Value::as_str) == Some("error");
println!("{}", serde_json::to_string_pretty(&value)?);
if is_error {
std::process::exit(1);
Expand Down Expand Up @@ -7907,8 +7905,7 @@ fn render_diff_report_for(cwd: &Path) -> Result<String, Box<dyn std::error::Erro
.args(["rev-parse", "--is-inside-work-tree"])
.current_dir(cwd)
.output()
.map(|o| o.status.success())
.unwrap_or(false);
.is_ok_and(|o| o.status.success());
if !in_git_repo {
return Ok(format!(
"Diff\n Result no git repository\n Detail {} is not inside a git project",
Expand Down Expand Up @@ -7940,8 +7937,7 @@ fn render_diff_json_for(cwd: &Path) -> Result<serde_json::Value, Box<dyn std::er
.args(["rev-parse", "--is-inside-work-tree"])
.current_dir(cwd)
.output()
.map(|o| o.status.success())
.unwrap_or(false);
.is_ok_and(|o| o.status.success());
if !in_git_repo {
return Ok(serde_json::json!({
"kind": "diff",
Expand Down Expand Up @@ -8175,8 +8171,7 @@ fn command_exists(name: &str) -> bool {
Command::new("which")
.arg(name)
.output()
.map(|output| output.status.success())
.unwrap_or(false)
.is_ok_and(|output| output.status.success())
}

fn write_temp_text_file(
Expand Down
Loading