fix(gateway): translate inbound document host paths to container paths for Docker backend#19048
Conversation
…s for Docker backend When terminal.backend is docker, inbound documents uploaded via messaging platforms (Telegram, Slack, Discord, Feishu, Email, etc.) are cached at a host path under ~/.hermes/cache/documents, but the container sandbox only sees them at the auto-mounted /root/.hermes/cache/documents path. This PR adds to_agent_visible_cache_path() in tools/credential_files.py (the natural sibling to get_cache_directory_mounts()) and calls it at the document-context-injection site in gateway/run.py so the agent always receives a path it can open directly, matching the mount layout already established by get_cache_directory_mounts() (NousResearch#4846). Scope: only Docker backend for now; other backends use different mount semantics and are left unchanged until verified. Fixes NousResearch#18787
|
Hey @ambition0802 — I'm the reporter of #18787. I went ahead and opened #19610 with the same fix not realising your PR was already in flight (apologies, that's on me — I only checked merged PRs). I've closed mine. Two pieces from my branch that might be useful for this PR if you want them:
Happy to push them as a fixup commit to your branch if you grant collaborator access on For the test set specifically I think it's worth landing alongside the fix since it locks in the contract for any future backend extensions. |
When terminal.backend is docker, inbound documents uploaded via messaging
platforms (Telegram, Slack, Discord, Feishu, Email, etc.) are cached at a host
path under ~/.hermes/cache/documents, but the container sandbox only sees them
at the auto-mounted /root/.hermes/cache/documents path.
This PR adds to_agent_visible_cache_path() in tools/credential_files.py (the
natural sibling to get_cache_directory_mounts()) and calls it at the
document-context-injection site in gateway/run.py so the agent always receives
a path it can open directly, matching the mount layout already established
by get_cache_directory_mounts() (#4846).
Scope: only Docker backend for now; other backends use different mount
semantics and are left unchanged until verified.
Fixes #18787