# NousResearch/hermes-agent · Docker backend bind-mount path translation issues

## Open now

- 3 issues, 3 PRs open on GitHub.
- #40368: \[Bug\] Docker backend generates container-internal paths for sandbox bind mounts when using host Docker socket (DooD on Unraid)
- #41541: ${HERMES_SKILL_DIR} resolves to host paths on remote terminal backends
- #50798: Sandbox skill + cache bind-mounts are empty under docker-compose self-host (sibling-container bind source uses in-container HERMES_HOME, not the host path)
- PR #40404: fix(docker): rewrite DooD auto-mount sources via host_cwd
- PR #75418: fix(docker): resolve sibling bind sources on host
- PR #80879: fix(skills): resolve skill paths to backend-visible locations on remote terminal backends

These items concern incorrect path resolution for bind mounts in Docker-based backends, including credential files, skill directories, cache paths, and document paths that reference container-internal paths instead of host-visible paths. Scenarios covered include sibling containers, Docker-out-of-Docker (DooD), and remote terminal backends.

## TL;DR

- 16 member(s): 3 open issue(s), 2 closed issue(s), 3 open PR(s), 1 merged PR(s), 7 PR(s) closed without merging.
- A fix was merged to main in PR #21184. Verify it addresses your case.
- **Recommended:** read PR #21184 (and any competing PRs below) before filing. Confirm the merged change covers your symptom.

## Maintainer resolution verdict

- Internal-tracker verdict over this cluster's issue members: `partially_resolved` · deciding PR(s): `pr-21184`. This is distinct from the fix status above. Weigh it yourself.

## How this cluster was grouped

- Link evidence (`STRUCTURAL_PARTIAL`): some members are connected by structural evidence (shared changed files, or a closing/superseded reference); the rest are joined by an automated relevance judgement over their text.
- Members outside that structural core may belong to a different underlying problem.
- Pairwise link density `0.11`: the share of member pairs that carry a link, counting a structural link in full and a relevance-only link at 0.36. `1.00` means every pair is linked.

## Open related issues

- #40368: \[Bug\] Docker backend generates container-internal paths for sandbox bind mounts when using host Docker socket (DooD on Unraid)
- #41541: ${HERMES_SKILL_DIR} resolves to host paths on remote terminal backends
- #50798: Sandbox skill + cache bind-mounts are empty under docker-compose self-host (sibling-container bind source uses in-container HERMES_HOME, not the host path)

## Closed / duplicate issues

- #18787: \[Bug\]: Inbound document host paths not translated to container paths under Docker backend
- #24483: Docker sandbox fails with exit 125 when container_persistent=true and credential files are registered

## Prior & competing PRs

- **#21184: fix(gateway): translate inbound document host paths to container paths for Docker backend (salvage #19048)**. merged to main · fix tier `verified`
  - maintainer direction: category `merged`; implication `superseded`
  - files: `gateway/run.py`, `tools/credential_files.py`
  - fix hunks:
  - `gateway/run.py`

    ```diff
    @@ -5757,6 +5757,7 @@ async def _prepare_inbound_message_text(
     
             if event.media_urls and event.message_type == MessageType.DOCUMENT:
                 import mimetypes as _mimetypes
    +            from tools.credential_files import to_agent_visible_cache_path
     
                 _TEXT_EXTENSIONS = {".txt", ".md", ".csv", ".log", ".json", ".xml", ".yaml", ".yml", ".toml", ".ini", ".cfg"}
                 for i, path in enumerate(event.media_urls):
    ```

    ```diff
    @@ -5777,16 +5778,21 @@ async def _prepare_inbound_message_text(
                     display_name = parts[2] if len(parts) >= 3 else basename
                     display_name = re.sub(r'[^\w.\- ]', '_', display_name)
     
    +                # Translate host cache path to in-container path if running under Docker backend.
    +                # This ensures the agent receives a path it can open inside its sandbox, as the
    +                # cache directories are auto-mounted at /root/.hermes/cache/* by get_cache_directory_mounts().
    +                agent_path = to_agent_visible_cache_path(path)
    +
                     if mtype.startswith("text/"):
                         context_note = (
                             f"[The user sent a text document: '{display_name}'. "
                             f"Its content has been included below. "
    -                        f"The file is also saved at: {path}]"
    +                        f"The file is also saved at: {agent_path}]"
                         )
                     else:
                         context_note = (
                             f"[The user sent a document: '{display_name}'. "
    -                        f"The file is saved at: {path}. "
    +                        f"The file is saved at: {agent_path}. "
                             f"Ask the user what they'd like you to do with it.]"
                         )
                     message_text = f"{context_note}\n\n{message_text}"
    ```
  - `tools/credential_files.py`

    ```diff
    @@ -374,6 +374,34 @@ def get_cache_directory_mounts(
         return mounts
     
     
    +def to_agent_visible_cache_path(
    +    host_path: str,
    +    container_base: str = "/root/.hermes",
    +) -> str:
    +    """Translate a host cache path to its mounted path inside the sandbox.
    +
    +    Returns the input unchanged if it is not under any auto-mounted cache
    +    directory, or if the active terminal backend does not require path
    +    translation (only Docker for now).
    +    """
    +    # Only Docker backend requires translation at this time.  Other backends
    +    # (Modal, Daytona, Vercel) use different mount semantics and will be
    +    # addressed separately if needed.  Backend is identified by TERMINAL_ENV
    +    # (same env var tools/terminal_tool.py reads in _get_environment_config).
    +    if os.environ.get("TERMINAL_ENV", "local") != "docker":
    +        return host_path
    +
    +    path = Path(host_path)
    +    for mount in get_cache_directory_mounts(container_base=container_base):
    +        host_dir = Path(mount["host_path"])
    +        try:
    +            rel = path.relative_to(host_dir)
    +            return str(Path(mount["container_path"]) / rel)
    +        except ValueError:
    +            continue
    +    return host_path
    +
    +
     def iter_cache_files(
         container_base: str = "/root/.hermes",
     ) -> List[Dict[str, str]]:
    ```
- **#41562: fix(skills): resolve skill directory paths for non-local terminal backends**. closed without merge · fix tier `suggested`
  - maintainer direction: category `superseded_by_pr`; implication `superseded`; refs `#41561`, `#41562`, `#41561`, `#41561`
  - _suggested-tier fix detail withheld; re-request with `?tier=all` to include it._
- **#18794: fix(gateway): translate document cache paths for docker**. closed without merge
  - maintainer direction: category `implemented_elsewhere`; implication `superseded`; refs `#18787`
- **#19048: fix(gateway): translate inbound document host paths to container paths for Docker backend**. closed without merge
  - maintainer direction: category `duplicate_of`; implication `duplicate`; refs `6d1b61d63`, `#18787`, `#19610`
- **#19610: fix(gateway): translate inbound cache paths to container paths for Docker backend**. closed without merge
  - maintainer direction: category `duplicate_of`; implication `duplicate`; refs `#19048`
- **#24555: fix(docker): remove corrupted sandbox dir before credential bind-mount**. closed without merge
  - maintainer direction: category `superseded_by_pr`; implication `superseded`; refs `#24490`, `#24483`, `#24490`
- **#40404: fix(docker): rewrite DooD auto-mount sources via host_cwd**. open
  - maintainer direction: category `uncategorized`; implication `needs_llm`
  - files: `tests/tools/test_docker_environment.py`, `tools/environments/docker.py`
- **#41561: fix(skills): resolve ${HERMES_SKILL_DIR} to backend-visible paths on remote terminal backends**. closed without merge
  - maintainer direction: category `volume_quota`; implication `active`; refs `#41541`
- **#50874: fix(docker): translate container paths to host paths for sibling mounts**. closed without merge
  - maintainer direction: category `uncategorized`; implication `needs_llm`
- **#75418: fix(docker): resolve sibling bind sources on host**. open
  - maintainer direction: category `implemented_elsewhere`; implication `superseded`
  - files: `tests/tools/test_docker_environment.py`, `tools/environments/docker.py`, `website/docs/user-guide/docker.md`
- **#80879: fix(skills): resolve skill paths to backend-visible locations on remote terminal backends**. open
  - maintainer direction: category `uncategorized`; implication `needs_llm`
  - files: `agent/skill_commands.py`, `agent/skill_path_mapping.py`, `agent/skill_preprocessing.py`, `tests/agent/test_skill_path_mapping.py`, `tools/credential_files.py`

## Fix status

- Merged to main in PR #21184 (cited above). No release data is tracked. Verify downstream.
- Fix last verified (merged) `2026-05-07`.
- Subsystem: `environments`
