fix(docker): pass RPC dir through exec env#13342
Conversation
4be8831 to
796e2f2
Compare
|
Related to #13537 which addresses the same root cause (HERMES_RPC_DIR not in container env). Review both PRs for potential overlap. |
1 similar comment
|
Related to #13537 which addresses the same root cause (HERMES_RPC_DIR not in container env). Review both PRs for potential overlap. |
|
Thanks for flagging the overlap. I compared this with #13537: this PR keeps the fix in the per-call execute path by forwarding HERMES_RPC_DIR through the environment backend's extra_env plumbing, with coverage in both code execution and Docker exec tests. #13537 takes a task-specific Docker RPC-dir approach and also updates Docker environment creation. I’m happy to defer or adapt if maintainers prefer that direction; otherwise this PR is the narrower patch for the container-env propagation path. |
Fixes #13142.
Root cause:
execute_codesetHERMES_RPC_DIRonly through the remote shell prefix. On Docker, the file-based hermes_tools RPC bridge also needs the RPC directory in the container execution environment; without it, tool calls from insideexecute_codecould silently resolve to the wrong default and reporttool_calls_made: 0.Fix summary:
extra_envthrough the execution environment interface.HERMES_RPC_DIRasextra_envwhen running the remote execute_code script, while keeping the existing shell prefix for compatibility.extra_envto Docker viadocker exec -e KEY=valueand to the local backend via the subprocess environment.execute_codepasses the RPC dir throughextra_envand Docker turns it intodocker exec -e HERMES_RPC_DIR=....Tests:
uv run --frozen --python 3.11 --extra dev pytest -o addopts= tests/tools/test_code_execution.py tests/tools/test_docker_environment.py -q->83 passed, 1 warninggit diff --check -- tools/code_execution_tool.py tools/environments/base.py tools/environments/docker.py tools/environments/local.py tools/environments/ssh.py tools/environments/modal.py tools/environments/daytona.py tools/environments/singularity.py tests/tools/test_code_execution.py tests/tools/test_docker_environment.pyNote:
tests/tools/test_docker_environment.py; the targeted suite passed.