Conversation
malaiwah
force-pushed
the
fix/file-tools-docker-config
branch
from
April 12, 2026 11:06
3b8bb85 to
c0f9be6
Compare
Three tool entry points build a container_config dict for _create_environment() but omit docker_forward_env, which is loaded by _get_env_config() but never forwarded: - tools/terminal_tool.py (terminal_tool, line ~1272) - tools/file_tools.py (_get_file_ops, line ~221) - tools/code_execution_tool.py (_get_or_create_environment, line ~483) All three share the same _active_environments cache keyed by task_id. Whichever tool creates the environment first determines the config for all subsequent tools in that session. If any of them creates without docker_forward_env, environment variables like GITHUB_TOKEN are missing from the sandbox for the entire session. Add docker_forward_env to container_config in all three locations, matching what _create_environment() already expects. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
malaiwah
force-pushed
the
fix/file-tools-docker-config
branch
from
April 12, 2026 11:22
c0f9be6 to
8e09afe
Compare
|
Likely duplicate of #14235 (merged) — that PR already added docker_forward_env/docker_env to container_config. |
This was referenced Apr 29, 2026
stevenchanin
added a commit
to stevenchanin/hermes-agent
that referenced
this pull request
Apr 29, 2026
`_get_or_create_env()` builds the `container_config` dict that's passed to `_create_environment()`, but it omits `docker_forward_env` and `docker_env`. Env vars listed in `terminal.docker_forward_env` are silently dropped when a Docker sandbox is provisioned via `execute_code`, so credentials-dependent CLIs (himalaya, vercel, gh, firebase, ...) fail with no-credentials errors even when the agent's whitelist names the right vars. The terminal_tool path was fixed in NousResearch#14235 and the file_tools path in NousResearch#12900. PR NousResearch#8320 originally fixed all three in one diff but went DIRTY once the other two merged independently and was incorrectly closed as a duplicate of NousResearch#14235 — the code_execution_tool chunk is still needed. Closes NousResearch#12534. Refs NousResearch#5722, NousResearch#16214, NousResearch#8320. Note: the docker_env config-bridging in cli.py (NousResearch#16214) is orthogonal and still required for terminal.docker_env values to actually reach _get_env_config(). Including the key here keeps shape parity with terminal_tool.py so wiring is in place once that fix lands.
5 tasks
Contributor
|
Fixed in #14235 |
6 tasks
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.
Summary
Add
docker_forward_envto thecontainer_configdict in three tool entry points that were missing it:tools/terminal_tool.py—terminal_tool()(line ~1272)tools/file_tools.py—_get_file_ops()(line ~221)tools/code_execution_tool.py—_get_or_create_environment()(line ~483)Problem
_get_env_config()loadsdocker_forward_envfromTERMINAL_DOCKER_FORWARD_ENV(line 650), and_create_environment()reads it fromcontainer_configto pass to the Docker backend (line 717-731). But none of the three callers that buildcontainer_configinclude it — the value is loaded then silently dropped.Severity: low for stock deployments. The default value is
[], so unless a user explicitly setsTERMINAL_DOCKER_FORWARD_ENV(e.g.["GITHUB_TOKEN", "NPM_TOKEN"]), the missing passthrough has no effect — the default[]in_create_environment()matches the intended empty value.When it does bite: if a user configures
TERMINAL_DOCKER_FORWARD_ENVand the model happens to usewrite_fileorexecute_codebeforeterminalin the same turn, those tools create the shared environment first (via_active_environmentscache) without forwarding the env vars. Theterminaltool then reuses the incomplete environment.Fix
Add
"docker_forward_env": config.get("docker_forward_env", [])to all threecontainer_configdicts, matching what_create_environment()already expects.Test plan
_get_env_config()returnsdocker_forward_env(line 650)_create_environment()reads it fromcontainer_config(line 717)[]==[]🤖 Generated with Claude Code