The all-in-one local AI studio for your desktop: chat, image and video generation and a coding agent in one free, open source app. Windows and Linux. No Docker, no terminal, no cloud required.
TypeScript agentai-chatai-studioall-in-onecoding-agentdesktop-appfluximage-generationlinuxllmlocal-ailocal-llmopen-sourceprivacyself-hostedstable-diffusionuncensoreduncensored-aivideo-generationwindows
fix(process): route shell.rs's foreground spawn through the adapter (3, 10)
purpleac5710807ca2
diff --git a/src-tauri/src/commands/shell.rs b/src-tauri/src/commands/shell.rsindex 64e9e541..a517b45a 100644--- a/src-tauri/src/commands/shell.rs+++ b/src-tauri/src/commands/shell.rs@@ -598,7 +598,16 @@ fn shell_execute_sync(let (shell_bin, shell_args) =shell_argv(cfg!(target_os = "windows"), shell.as_deref(), &command);- let mut cmd = Command::new(&shell_bin);+ // Runde 3, Nachbesserung 3: the background twin in bg_tasks.rs already+ // runs the shell itself through `foreign_system_command_tokio` (K14+ // Runde 2, Punkt 5/6) because it is a foreign program exactly like+ // `git`/`python`, and an AppImage's poisoned LD_LIBRARY_PATH can break+ // it the same way. This, the FOREGROUND twin using the identical+ // `shell_argv`, was the gap the review named as the most visible one+ // left: every `sh -c`/`bash -c` the coding agent runs here inherited+ // the poisoned environment, and with it every `git`/`pip`/`python` the+ // user types inside it.+ let mut cmd = crate::process_util::foreign_system_command(&shell_bin);cmd.args(&shell_args);// Append extra argsdiff --git a/src-tauri/src/process_util.rs b/src-tauri/src/process_util.rsindex d5c783a6..19e08017 100644--- a/src-tauri/src/process_util.rs+++ b/src-tauri/src/process_util.rs@@ -1186,10 +1186,37 @@ mod command_new_coverage_guard {("src/commands/install/lmstudio_install.rs", 0),("src/commands/install/ollama.rs", 0),("src/commands/install/children.rs", 0),+ // Runde 3, Nachbesserung 3: the foreground shell spawn now goes+ // through `foreign_system_command` too, matching its background+ // twin (bg_tasks.rs). The remaining 1 is `taskkill.exe` at+ // shell.rs:204, `#[cfg(windows)]`-gated and windows-only exactly+ // like the review's own Ausnahmeliste for that file names.+ ("src/commands/shell.rs", 1),];+ /// Runde 3, Nachbesserung 10: the review caught this before it bit+ /// anyone (`review-engine.md` Runde 2 Abschnitt 2, letzter Absatz): a+ /// file whose only test module is tagged `#[cfg(all(test, unix))]` (or+ /// any other compound predicate with `test` as one of the conjuncts)+ /// has NO literal `#[cfg(test)]` substring anywhere, so the plain+ /// search used to fall through to "no test module, count the whole+ /// file as shipping code". `process_util.rs`'s own `kill_tree_tests`+ /// module only escaped that by luck: this file also happens to carry a+ /// plain `#[cfg(test)]` later on. `shell.rs` does not have that luck+ /// once `foreign_system_command` covers its foreground shell spawn+ /// (Nachbesserung 3): its ONLY other test module is+ /// `#[cfg(all(test, windows))]`, sitting ahead of its first plain+ /// `#[cfg(test)]`, so the truncation point matters for real now, not+ /// just in theory. This takes the EARLIEST of either shape.fn shipping_half(src: &str) -> &str {- match src.find("#[cfg(test)]") {+ let plain = src.find("#[cfg(test)]");+ let compound = src.find("#[cfg(all(test");+ let at = match (plain, compound) {+ (Some(a), Some(b)) => Some(a.min(b)),+ (Some(a), None) | (None, Some(a)) => Some(a),+ (None, None) => None,+ };+ match at {Some(at) => &src[..at],None => src,}@@ -1232,6 +1259,19 @@ mod command_new_coverage_guard {assert_eq!(count_command_new(shipping_half(synthetic)), 1);}+ /// Runde 3, Nachbesserung 10: a file whose ONLY test module is tagged+ /// `#[cfg(all(test, unix))]` (no bare `#[cfg(test)]` anywhere) must+ /// still have its test-only `Command::new` excluded, not counted as+ /// shipping code. Before this fix, `shipping_half` found no plain+ /// `#[cfg(test)]` and returned the WHOLE file, silently double-counting+ /// exactly the shape shell.rs now has.+ #[test]+ fn a_compound_cfg_test_predicate_is_also_recognized() {+ let synthetic = "fn spawn_it() {\n let _ = Command::new(\"lms\");\n}\n\n\+ #[cfg(all(test, unix))]\nmod tests {\n fn t() { Command::new(\"x\"); }\n}\n";+ assert_eq!(count_command_new(shipping_half(synthetic)), 1);+ }+/// `remote.rs`'s own two spots, checked by name instead of a whole-file/// split (see the module doc comment for why). Both were the review's/// coverage-table entries for this file. A full parse of each