From 469149e7ca8af83bbba1bc481037063e2ebad840 Mon Sep 17 00:00:00 2001 From: AIEN Date: Sun, 20 Sep 2026 00:48:25 -0500 Subject: [PATCH] fix(gateway): enforce workspace capability sandbox on websocket shell execution --- src/gateway.rs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/gateway.rs b/src/gateway.rs index ce51c2b..0091ce0 100644 --- a/src/gateway.rs +++ b/src/gateway.rs @@ -551,13 +551,12 @@ async fn handle_socket(mut socket: WebSocket, state: GatewayState) { } "shell" => { let cmd_str = parsed.get("command").and_then(|v| v.as_str()).unwrap_or("echo shell ready"); - let res = Command::new("sh").arg("-c").arg(cmd_str).output().await; - let out = match res { - Ok(o) => json!({ + let out = match state.skills.workspace().execute_shell(cmd_str, None, 15) { + Ok(stdout) => json!({ "type": "shell_output", - "stdout": String::from_utf8_lossy(&o.stdout), - "stderr": String::from_utf8_lossy(&o.stderr), - "exit_code": o.status.code().unwrap_or(-1), + "stdout": stdout, + "stderr": "", + "exit_code": 0, }), Err(e) => json!({ "type": "shell_error",