fix(file_tools): pass docker_volumes to sandbox container config#687
Merged
teknium1 merged 1 commit intoNousResearch:mainfrom Mar 10, 2026
Merged
Conversation
4c3bdd5 to
8ab2167
Compare
Author
|
Depends on #431 (gateway docker_volumes bridge) — the env var this fix consumes is set by that PR. |
2ebb495 to
2e7608e
Compare
file_tools.py creates its own Docker sandbox when read_file/search_files runs before any terminal command. The container_config was missing docker_volumes, so the sandbox had no user volume mounts — breaking access to heartbeat state, cron output, and all other mounted data. Matches the existing pattern in terminal_tool.py:872. Missed in original PR #158 (feat: add docker_volumes config). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2e7608e to
c3dec1d
Compare
Contributor
|
Good catch @manuelschipper — verified against terminal_tool.py:886 which has the exact same line. Merged to main. Thanks! 🎉 |
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
file_tools.pycreates its own Docker sandbox environment whenread_file/search_files/write_file/patchruns before any terminal command. Thecontainer_configdict was missingdocker_volumes, so the sandbox was created without any user volume mounts.This means if a bot's first tool call in a session is a file operation (common — bots often read config files before running commands), the sandbox has no access to mounted data like heartbeat state, cron output, credentials, etc. All subsequent tools in that session reuse the same broken sandbox.
Root cause
PR #158 (
feat: add docker_volumes config for custom volume mounts) addedcontainer_configpassing tofile_tools.pybut forgot to include thedocker_volumeskey.terminal_tool.pyhas it correctly at line 872.Changes
"docker_volumes": config.get("docker_volumes", [])tocontainer_configinfile_tools.py:_get_file_ops(), matchingterminal_tool.pyHow to reproduce
docker_volumesinconfig.yamlread_file(notterminal)terminalruns first instead, sandbox is created correctly (with volumes) and file tools reuse it — masking the bugTest plan
read_file /home/pn/heartbeat-state/state.json→ error (file not found)read_filesuccessfully reads the file through mounted volume🤖 Generated with Claude Code