summaryrefslogtreecommitdiffstats
path: root/src/tools/mod.rs
diff options
context:
space:
mode:
authorsalmonik <salmonik@tuta.io>2026-11-15 15:38:57 +0100
committersalmonik <salmonik@tuta.io>2026-11-15 15:38:57 +0100
commitc7afd1ea752aeff0310ac7c6b78d091ac360c760 (patch)
tree461f22fc3633ea1ea0e23ccbf330d7a55a92bea8 /src/tools/mod.rs
parent0.4.1 + 0.4.2: abort integrity, stream completeness, tool-call indexing (diff)
downloadagent686-c7afd1ea752aeff0310ac7c6b78d091ac360c760.tar.gz
agent686-c7afd1ea752aeff0310ac7c6b78d091ac360c760.zip
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
Diffstat (limited to 'src/tools/mod.rs')
-rw-r--r--src/tools/mod.rs4
1 files changed, 2 insertions, 2 deletions
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 {
25} 25}
26 26
27/// Tools that execute immediately. 27/// Tools that execute immediately.
28pub fn run(name: &str, args: &Value) -> Result<String, String> { 28pub fn run(name: &str, args: &Value, cancel: &std::sync::atomic::AtomicBool) -> Result<String, String> {
29 match name { 29 match name {
30 "read" => fs::read(args), 30 "read" => fs::read(args),
31 "grep" => fs::grep(args), 31 "grep" => fs::grep(args),
32 "glob" => fs::glob(args), 32 "glob" => fs::glob(args),
33 "bash" => shell::bash(args, std::time::Duration::from_secs(120)), 33 "bash" => shell::bash(args, std::time::Duration::from_secs(120), cancel),
34 other => Err(unknown(other)), 34 other => Err(unknown(other)),
35 } 35 }
36} 36}