From 485b25a6b4e00779830b342bb3e70d2a4bf089cc Mon Sep 17 00:00:00 2001 From: YeonGyu-Kim Date: Thu, 2 Apr 2026 18:14:09 +0900 Subject: [PATCH] fix: resolve merge conflicts between commands-parity and stub-commands branches - Fix Commit/DebugToolCall variant mismatch (unit variants, not struct) - Apply cargo fmt --- rust/crates/rusty-claude-cli/src/main.rs | 38 ++++++++++++++---------- rust/crates/tools/src/lib.rs | 4 +-- 2 files changed, 24 insertions(+), 18 deletions(-) diff --git a/rust/crates/rusty-claude-cli/src/main.rs b/rust/crates/rusty-claude-cli/src/main.rs index 9c7e833..b8c35cc 100644 --- a/rust/crates/rusty-claude-cli/src/main.rs +++ b/rust/crates/rusty-claude-cli/src/main.rs @@ -1749,8 +1749,8 @@ impl LiveCli { self.run_bughunter(scope.as_deref())?; false } - SlashCommand::Commit { args } => { - self.run_commit(args.as_deref())?; + SlashCommand::Commit => { + self.run_commit(None)?; false } SlashCommand::Pr { context } => { @@ -1769,8 +1769,8 @@ impl LiveCli { self.run_teleport(target.as_deref())?; false } - SlashCommand::DebugToolCall { args } => { - self.run_debug_tool_call(args.as_deref())?; + SlashCommand::DebugToolCall => { + self.run_debug_tool_call(None)?; false } SlashCommand::Sandbox => { @@ -2272,10 +2272,7 @@ impl LiveCli { Ok(()) } - fn run_debug_tool_call( - &self, - args: Option<&str>, - ) -> Result<(), Box> { + fn run_debug_tool_call(&self, args: Option<&str>) -> Result<(), Box> { validate_no_args("/debug-tool-call", args)?; println!("{}", render_last_tool_debug_report(self.runtime.session())?); Ok(()) @@ -2291,12 +2288,16 @@ impl LiveCli { return Ok(()); } - println!("{}", format_commit_preflight_report(branch.as_deref(), summary)); + println!( + "{}", + format_commit_preflight_report(branch.as_deref(), summary) + ); Ok(()) } fn run_pr(&self, context: Option<&str>) -> Result<(), Box> { - let branch = resolve_git_branch_for(&env::current_dir()?).unwrap_or_else(|| "unknown".to_string()); + let branch = + resolve_git_branch_for(&env::current_dir()?).unwrap_or_else(|| "unknown".to_string()); println!("{}", format_pr_report(&branch, context)); Ok(()) } @@ -3017,7 +3018,10 @@ fn indent_block(value: &str, spaces: usize) -> String { .join("\n") } -fn validate_no_args(command_name: &str, args: Option<&str>) -> Result<(), Box> { +fn validate_no_args( + command_name: &str, + args: Option<&str>, +) -> Result<(), Box> { if let Some(args) = args.map(str::trim).filter(|value| !value.is_empty()) { return Err(format!( "{command_name} does not accept arguments. Received: {args}\nUsage: {command_name}" @@ -4853,9 +4857,9 @@ mod tests { permission_policy, print_help_to, push_output_block, render_config_report, render_diff_report, render_memory_report, render_repl_help, render_resume_usage, resolve_model_alias, resolve_session_reference, response_to_events, - resume_supported_slash_commands, run_resume_command, validate_no_args, - slash_command_completion_candidates_with_sessions, status_context, CliAction, - CliOutputFormat, GitWorkspaceSummary, InternalPromptProgressEvent, + resume_supported_slash_commands, run_resume_command, + slash_command_completion_candidates_with_sessions, status_context, validate_no_args, + CliAction, CliOutputFormat, GitWorkspaceSummary, InternalPromptProgressEvent, InternalPromptProgressState, LiveCli, SlashCommand, StatusUsage, DEFAULT_MODEL, }; use api::{MessageResponse, OutputContentBlock, Usage}; @@ -5590,14 +5594,16 @@ mod tests { assert!(preflight.contains("Result ready")); assert!(preflight.contains("Branch feature/ux")); assert!(preflight.contains("Workspace dirty · 2 files · 1 staged, 1 unstaged")); - assert!(preflight.contains("Action create a git commit from the current workspace changes")); + assert!(preflight + .contains("Action create a git commit from the current workspace changes")); } #[test] fn commit_skipped_report_points_to_next_steps() { let report = format_commit_skipped_report(); assert!(report.contains("Reason no workspace changes")); - assert!(report.contains("Action create a git commit from the current workspace changes")); + assert!(report + .contains("Action create a git commit from the current workspace changes")); assert!(report.contains("/status to inspect context")); assert!(report.contains("/diff to inspect repo changes")); } diff --git a/rust/crates/tools/src/lib.rs b/rust/crates/tools/src/lib.rs index 758a6b6..ab3eb61 100644 --- a/rust/crates/tools/src/lib.rs +++ b/rust/crates/tools/src/lib.rs @@ -3157,8 +3157,8 @@ mod tests { .expect_err("unknown plugin permission should fail"); assert!(unknown_permission.contains("unsupported plugin permission: admin")); - let empty_permission = permission_mode_from_plugin("") - .expect_err("empty plugin permission should fail"); + let empty_permission = + permission_mode_from_plugin("").expect_err("empty plugin permission should fail"); assert!(empty_permission.contains("unsupported plugin permission: ")); }