From ff532465cfcc4162c5e20b39786a7bba7c60f2bc Mon Sep 17 00:00:00 2001 From: ssmithx Date: Thu, 23 Jul 2026 02:51:58 +0000 Subject: [PATCH] fix(mesh): capture actual esptool/rnodeconf output in the failure error MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit run_streamed's failure path only reported "Command exited with exit status: N" — the real stderr (already captured line-by-line into job.log_tail for the UI's live poll) never made it into the error that gets logged to journald. A real esptool failure just now showed only the bare exit code, with esptool's actual error text sitting in-memory, visible in the UI but not diagnosable from the server logs. Now includes the last 10 log_tail lines in the returned error, so the actual tool output shows up in journalctl too. Co-Authored-By: Claude Sonnet 5 --- core/archipelago/src/mesh/flash.rs | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/core/archipelago/src/mesh/flash.rs b/core/archipelago/src/mesh/flash.rs index 31eaf1ce..229dcf93 100644 --- a/core/archipelago/src/mesh/flash.rs +++ b/core/archipelago/src/mesh/flash.rs @@ -838,7 +838,23 @@ async fn run_streamed(mut cmd: Command, stdin: Option>, job: &Arc = job + .snapshot() + .await + .log_tail + .iter() + .rev() + .take(10) + .rev() + .cloned() + .collect(); + anyhow::bail!("Command exited with {status}\n{}", tail.join("\n")); } Ok(()) }