From c7afd1ea752aeff0310ac7c6b78d091ac360c760 Mon Sep 17 00:00:00 2001 From: salmonik Date: Sun, 15 Nov 2026 15:38:57 +0100 Subject: 0.4.3: kill process groups, bound bash output, keep the key out of tool env - setsid-style process group kill on timeout and on Ctrl-C - 64 MiB RLIMIT_FSIZE so a runaway command cannot fill /tmp - OPENCODE_API_KEY removed from child environment - sessions 0600/0700, history 0600 and trimmed --- src/tools/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/tools/mod.rs') diff --git a/src/tools/mod.rs b/src/tools/mod.rs index 7a1a26d..a8851ab 100644 --- a/src/tools/mod.rs +++ b/src/tools/mod.rs @@ -25,12 +25,12 @@ pub fn approval(name: &str) -> Approval { } /// Tools that execute immediately. -pub fn run(name: &str, args: &Value) -> Result { +pub fn run(name: &str, args: &Value, cancel: &std::sync::atomic::AtomicBool) -> Result { match name { "read" => fs::read(args), "grep" => fs::grep(args), "glob" => fs::glob(args), - "bash" => shell::bash(args, std::time::Duration::from_secs(120)), + "bash" => shell::bash(args, std::time::Duration::from_secs(120), cancel), other => Err(unknown(other)), } } -- cgit v1.2.3