From e6bbac771d460d75d51c7c34c072888d520d9603 Mon Sep 17 00:00:00 2001 From: Bryan Helmkamp Date: Wed, 4 Mar 2026 10:17:02 -0500 Subject: [PATCH] Show failure error message when a stage fails in ProgressUI Co-Authored-By: Claude Opus 4.6 --- crates/arc-workflows/src/cli/progress.rs | 35 ++++++++++++++---------- crates/arc-workflows/src/cli/run.rs | 6 +++- 2 files changed, 26 insertions(+), 15 deletions(-) diff --git a/crates/arc-workflows/src/cli/progress.rs b/crates/arc-workflows/src/cli/progress.rs index 8442748c7..ebaa83cd6 100644 --- a/crates/arc-workflows/src/cli/progress.rs +++ b/crates/arc-workflows/src/cli/progress.rs @@ -314,8 +314,19 @@ impl ProgressUI { }; self.finish_stage(node_id, name, glyph, &prefix); } - WorkflowRunEvent::StageFailed { node_id, name, .. } => { + WorkflowRunEvent::StageFailed { + node_id, + name, + failure, + .. + } => { self.finish_stage(node_id, name, red_cross(), ""); + let red = Style::new().red(); + self.insert_info_line(&format!( + "{} {}", + red.apply_to("Error:"), + failure.message, + )); } WorkflowRunEvent::ParallelStarted { .. } => { // The fork stage is the (only) active stage at this point. @@ -661,12 +672,10 @@ impl ProgressUI { let dim = Style::new().dim(); self.insert_info_line_for_stage( stage_node_id, - &format!( - "{}", - dim.apply_to(format!( - "\u{27f3} compaction: {original_turn_count} \u{2192} {preserved_turn_count} turns, {tracked_file_count} files" - )) - ), + &dim.apply_to(format!( + "\u{27f3} compaction: {original_turn_count} \u{2192} {preserved_turn_count} turns, {tracked_file_count} files" + )) + .to_string(), ); } AgentEvent::LlmRetry { @@ -694,13 +703,11 @@ impl ProgressUI { let short_id = &agent_id[..agent_id.len().min(8)]; self.insert_info_line_for_stage( stage_node_id, - &format!( - "{}", - dim.apply_to(format!( - "\u{25b8} subagent[{short_id}] \"{}\"", - truncate(task, 50) - )) - ), + &dim.apply_to(format!( + "\u{25b8} subagent[{short_id}] \"{}\"", + truncate(task, 50) + )) + .to_string(), ); } AgentEvent::SubAgentCompleted { diff --git a/crates/arc-workflows/src/cli/run.rs b/crates/arc-workflows/src/cli/run.rs index 0c243ec23..8ff773b8b 100644 --- a/crates/arc-workflows/src/cli/run.rs +++ b/crates/arc-workflows/src/cli/run.rs @@ -246,7 +246,11 @@ pub async fn run_command( // 2. Pre-flight: check git cleanliness before creating any files // (must happen before logs dir is created, which may be inside the repo) - let sandbox_provider = resolve_sandbox_provider(args.sandbox, run_cfg.as_ref(), &run_defaults)?; + let sandbox_provider = if args.dry_run { + SandboxProvider::Local + } else { + resolve_sandbox_provider(args.sandbox, run_cfg.as_ref(), &run_defaults)? + }; let preserve_sandbox = resolve_preserve_sandbox(args.preserve_sandbox, run_cfg.as_ref(), &run_defaults); let original_cwd = std::env::current_dir()?;