fix(docker): forward HERMES_RPC_DIR to sandbox containers for execute_code RPC#13537
Open
Tranquil-Flow wants to merge 2 commits into
Open
fix(docker): forward HERMES_RPC_DIR to sandbox containers for execute_code RPC#13537Tranquil-Flow wants to merge 2 commits into
Tranquil-Flow wants to merge 2 commits into
Conversation
7ea3821 to
7ed6ed0
Compare
7ed6ed0 to
03bf587
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
When
execute_coderuns inside a Docker sandbox,hermes_tools.pyneedsHERMES_RPC_DIRto communicate tool calls back to the host. Previously,HERMES_RPC_DIRwas only set inline for thepython3 script.pyprocess, not in the container's persistent environment — so the RPC polling thread and any child processes couldn't read it, resulting intool_calls_made: 0.Related Issue
Closes #13142
Type of Change
Changes Made
Three-file fix:
tools/environments/docker.py: Newget_docker_rpc_dir(task_id)function that returns a deterministic, task-scoped path under$TMPDIR/hermes_rpc/<safe_task_id>. Task ID is sanitized for filesystem safety.tools/code_execution_tool.py: For Docker environments, uses the task-scoped RPC dir (not nested under the sandbox dir). Creates it explicitly, passes it via env prefix, and cleans it up separately.tools/terminal_tool.py: InjectsHERMES_RPC_DIRintodocker_envviasetdefaultso all container exec calls see it. Respects explicit overrides already set in config.How to Test
_execute_remotewith task-scoped RPC dir.Checklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/ -qand all tests passDocumentation & Housekeeping
docs/, docstrings) — or N/Acli-config.yaml.exampleif I added/changed config keys — or N/ACONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows — or N/AScreenshots / Logs