aboutsummaryrefslogtreecommitdiffstats
path: root/src/doctor.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/doctor.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/doctor.rs')
-rw-r--r--src/doctor.rs15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/doctor.rs b/src/doctor.rs
index 42d24a8..65fca50 100644
--- a/src/doctor.rs
+++ b/src/doctor.rs
@@ -19,7 +19,20 @@ pub fn run(cfg: &Config) -> i32 {
19 19
20 match config::key_source() { 20 match config::key_source() {
21 KeySource::Env => row(true, "key", "present in OPENCODE_API_KEY"), 21 KeySource::Env => row(true, "key", "present in OPENCODE_API_KEY"),
22 KeySource::File(path) => row(true, "key", &format!("present in {}", path.display())), 22 KeySource::File(path) => {
23 row(true, "key", &format!("present in {}", path.display()));
24 use std::os::unix::fs::PermissionsExt;
25 if let Ok(meta) = std::fs::metadata(&path) {
26 if meta.permissions().mode() & 0o077 != 0 {
27 println!(
28 "{:<13} {:<4} {} is readable by other users; chmod 600 it",
29 "key perms",
30 "WARN",
31 path.display()
32 );
33 }
34 }
35 }
23 KeySource::Missing => { 36 KeySource::Missing => {
24 row( 37 row(
25 false, 38 false,