summaryrefslogtreecommitdiff
path: root/internal
diff options
context:
space:
mode:
Diffstat (limited to 'internal')
-rw-r--r--internal/executor/container.go4
-rw-r--r--internal/executor/container_test.go1
2 files changed, 5 insertions, 0 deletions
diff --git a/internal/executor/container.go b/internal/executor/container.go
index 4f8fa06..f78715d 100644
--- a/internal/executor/container.go
+++ b/internal/executor/container.go
@@ -496,6 +496,10 @@ func (r *ContainerRunner) buildDockerArgs(workspace, claudeHome, taskID string)
"-w", "/workspace",
"--env-file", hostEnvFile,
"-e", "HOME=/home/agent",
+ // The container is an isolated sandbox; IS_SANDBOX=1 lets the claude CLI
+ // honor --permission-mode bypassPermissions even when the agent runs as
+ // root (buildDockerArgs maps --user to the host uid, which may be 0).
+ "-e", "IS_SANDBOX=1",
"-e", "CLAUDOMATOR_API_URL=" + apiURL,
"-e", "CLAUDOMATOR_TASK_ID=" + taskID,
"-e", "CLAUDOMATOR_DROP_DIR=" + r.DropsDir,
diff --git a/internal/executor/container_test.go b/internal/executor/container_test.go
index 521e1cb..5c3fd2e 100644
--- a/internal/executor/container_test.go
+++ b/internal/executor/container_test.go
@@ -37,6 +37,7 @@ func TestContainerRunner_BuildDockerArgs(t *testing.T) {
"-w", "/workspace",
"--env-file", "/tmp/ws/.claudomator-env",
"-e", "HOME=/home/agent",
+ "-e", "IS_SANDBOX=1",
"-e", "CLAUDOMATOR_API_URL=http://host.docker.internal:8484",
"-e", "CLAUDOMATOR_TASK_ID=task-123",
"-e", "CLAUDOMATOR_DROP_DIR=/data/drops",