feat: configurable exec timeout per request (--timeout flag, default 30s)

This commit is contained in:
Helios Agent 2026-03-03 16:05:29 +01:00
parent 1c0af1693b
commit 537ed95a3c
No known key found for this signature in database
GPG key ID: C8259547CD8309B5
5 changed files with 44 additions and 17 deletions

View file

@ -392,8 +392,7 @@ async fn handle_message(
ClientMessage::Ack { request_id }
}
ServerMessage::ExecRequest { request_id, command } => {
// Truncate long commands for display
ServerMessage::ExecRequest { request_id, command, timeout_ms } => {
let cmd_display = if command.len() > 60 {
format!("{}", &command[..60])
} else {
@ -401,7 +400,7 @@ async fn handle_message(
};
log_cmd!("exec {}", cmd_display);
let mut sh = shell.lock().await;
match sh.run(&command).await {
match sh.run(&command, timeout_ms).await {
Ok((stdout, stderr, exit_code)) => {
let out = stdout.trim().lines().next().unwrap_or("").to_string();
let out_display = if out.len() > 60 {