Skip to content

Commit 5d553ca

Browse files
committed
fix(remote-worker): create /workspace in the leaf images
The harness execs every tool call from its sandbox working directory, which defaults to /workspace (KAGENTI_SANDBOX_CWD, select-sandbox.ts). Neither leaf image created it, so the worker's `bash -c` died before running anything the caller asked for: bash: line 1: cd: /workspace: No such file or directory Command exited with code 1 and the harness reported a tool error for a sandbox that was attached, healthy, and reachable. Found on a real VM run while proving that /turn now routes tool calls into the pool: the exec arrived at the leaf correctly and died on the cd, which is a more confusing failure than not arriving at all -- the pool looks fine, the relay looks fine, and only the tool result says otherwise. Both image definitions get it, since either can be the sandbox: Dockerfile (multi-stage, builds the binary) and Dockerfile.runtime (packages a prebuilt one). Owned 1001:0 and mode 775 because that is the uid/gid these images run as under the nonroot-v2 SCC, so the agent can write in its own workspace. This is what the Dockerfile's own comment already promised and did not deliver -- "this stage exists so the standalone demo image works on its own". It did not: as a sandbox it failed every tool call. Verified on hardware after rebuilding: /workspace present as drwxrwxr-x 1001 root, all three leaves attached, and a /turn tool call's file landed in sh-sandbox-2 while nothing appeared in the supervisor unit's PrivateTmp namespace -- the negative half being the one that matters, since before the routing fix that was the only place it ever appeared. Assisted-By: Claude (Anthropic AI) <noreply@anthropic.com> Signed-off-by: Paolo Dettori <dettori@us.ibm.com>
1 parent 694464d commit 5d553ca

2 files changed

Lines changed: 14 additions & 0 deletions

File tree

remote-worker/Dockerfile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,16 @@ FROM registry.access.redhat.com/ubi9/ubi-minimal:latest
3030
RUN microdnf install -y --nodocs bash coreutils-single findutils file \
3131
&& microdnf clean all
3232
COPY --from=build /out/remote-worker /usr/local/bin/remote-worker
33+
# The harness execs every tool call from its sandbox working directory, which defaults to
34+
# /workspace (KAGENTI_SANDBOX_CWD, select-sandbox.ts). Without this directory the worker's
35+
# `bash -c` fails before running anything the caller asked for:
36+
# bash: line 1: cd: /workspace: No such file or directory
37+
# Command exited with code 1
38+
# and the harness reports a tool error for a sandbox that is otherwise healthy and attached --
39+
# observed on a real VM run, where the exec reached the leaf correctly and died on the cd. Owned by
40+
# 1001:0 because that is the uid this image runs as (gid 0, matching the nonroot-v2 SCC below), so
41+
# the agent can actually write in its own workspace.
42+
RUN mkdir -p /workspace && chown 1001:0 /workspace && chmod 775 /workspace
3343
# Matches the nonroot-v2 SCC deploy-incluster.sh applies.
3444
USER 1001
3545
ENTRYPOINT ["/usr/local/bin/remote-worker"]

remote-worker/Dockerfile.runtime

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,9 @@ FROM registry.access.redhat.com/ubi9/ubi-minimal:latest
1414
RUN microdnf install -y --nodocs bash coreutils-single findutils file \
1515
&& microdnf clean all
1616
COPY remote-worker /usr/local/bin/remote-worker
17+
# See the same block in ./Dockerfile: the harness execs tool calls from /workspace (the default
18+
# KAGENTI_SANDBOX_CWD), and without it every exec dies on `cd` before running the command, which
19+
# surfaces as a tool error from a sandbox that is attached and healthy.
20+
RUN mkdir -p /workspace && chown 1001:0 /workspace && chmod 775 /workspace
1721
USER 1001
1822
ENTRYPOINT ["/usr/local/bin/remote-worker"]

0 commit comments

Comments
 (0)