Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/agent_env/agents/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ the folder changes. A run that deploys the agent registers that image when it's
pulls it by its digest and builds it from this folder only when it can't, and a provider that runs images by name can
run it. The CLI's version is the Dockerfile's
`CLAUDE_CODE_VERSION`. The image gives the scripts the model runs
`node`, without npm or npx, and the Python packages `model-requirements.txt` pins: boto3, and openpyxl, pypdf,
`node`, without npm or npx; `jq`, which the CLI tells the model to query an MCP result with when the result is over its
token cap and saved to a file; and the Python packages `model-requirements.txt` pins: boto3, and openpyxl, pypdf,
python-docx and python-pptx, which read the .xlsx, .pdf, .docx and .pptx files tasks often give the model. Without them
a script that opens such a file stops at `ModuleNotFoundError`, and the model spends turns working around it or fails
the task for a reason that isn't the model's; a sandbox with no network can't install them either. They add about 50 MB,
Expand Down
3 changes: 2 additions & 1 deletion src/agent_env/agents/agents/claude-code/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ FROM public.ecr.aws/docker/library/node:22-slim@sha256:c3de60bf2f9dd0ac6370e6117

FROM public.ecr.aws/docker/library/python:3.11-slim@sha256:c20888b6acdd1e63e1c433a185bf3ad162c0288fe484616ce062e0d28add2900
# poppler-utils: the CLI's Read tool runs pdftoppm for a PDF's pages.
RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates curl poppler-utils \
# jq: the CLI saves an MCP result over its token cap to a file and tells the model to query it with jq.
RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates curl jq poppler-utils \
&& rm -rf /var/lib/apt/lists/*
# Claude Code's native build for this machine's platform, checked against its release manifest.
ARG CLAUDE_CODE_VERSION=2.1.322
Expand Down
6 changes: 6 additions & 0 deletions tst/unit/agents/claude_code/test_image_contract.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ def test_the_packages_the_image_gives_the_models_python_are_pinned():
assert "-r requirements.txt -r model-requirements.txt" in DOCKERFILE


def test_the_image_installs_jq_which_the_cli_tells_the_model_to_query_a_saved_mcp_result_with():
apt = re.search(r"apt-get install -y --no-install-recommends ([^\\&]+)", DOCKERFILE)

assert apt and {"jq", "poppler-utils"} <= set(apt.group(1).split()), apt


def test_the_image_pins_its_cli_checks_its_checksum_and_keeps_tls_on():
assert re.search(r"^ARG CLAUDE_CODE_VERSION=\d+\.\d+\.\d+$", DOCKERFILE, re.MULTILINE)
assert "sha256sum -c" in DOCKERFILE
Expand Down
Loading