NousResearch/hermes-agent · error · PermissionError

ACP file-system paths must be absolute.

Error message

ACP file-system paths must be absolute.

What it means

The ACP (Agent Client Protocol) file-system bridge in agent/copilot_acp_client.py received a relative path in an fs/read_text_file or fs/write_text_file request. _ensure_path_within_cwd requires absolute paths because the ACP peer (GitHub Copilot CLI) may have a different process cwd, making relative paths ambiguous and unsafe to resolve.

Source

Thrown at agent/copilot_acp_client.py:373

    parts: list[str] = []
    cursor = 0
    for start, end in merged:
        if cursor < start:
            parts.append(text[cursor:start])
        cursor = max(cursor, end)
    if cursor < len(text):
        parts.append(text[cursor:])

    cleaned = "\n".join(p.strip() for p in parts if p and p.strip()).strip()
    return extracted, cleaned



def _ensure_path_within_cwd(path_text: str, cwd: str) -> Path:
    candidate = Path(path_text)
    if not candidate.is_absolute():
        raise PermissionError("ACP file-system paths must be absolute.")
    resolved = candidate.resolve()
    root = Path(cwd).resolve()
    try:
        resolved.relative_to(root)
    except ValueError as exc:
        raise PermissionError(f"Path '{resolved}' is outside the session cwd '{root}'.") from exc
    return resolved


class _ACPChatCompletions:
    def __init__(self, client: "CopilotACPClient"):
        self._client = client

    def create(self, **kwargs: Any) -> Any:
        return self._client._create_chat_completion(**kwargs)


class _ACPChatNamespace:

View on GitHub (pinned to c896c09c42)

Solutions

  1. Update GitHub Copilot CLI to the current version (npm install -g @github/copilot) so it sends absolute paths.
  2. If using a custom ACP command via HERMES_COPILOT_ACP_COMMAND, ensure it emits absolute paths in fs methods.
  3. Report to the Hermes maintainers if a current Copilot CLI still sends relative paths.
Defensive patterns

Strategy: validation

Validate before calling

from pathlib import Path

def valid_acp_fs_path(path_text: str) -> bool:
    return Path(path_text).is_absolute()

Try / catch

try:
    handle_fs_request(params)
except PermissionError as e:
    if "must be absolute" in str(e):
        # normalize to absolute relative to cwd and retry once
        ...

Prevention

When it happens

Trigger: A JSON-RPC fs request from the Copilot ACP process whose params.path is relative (e.g. 'src/main.py'). Raised before any resolution — Path(path_text).is_absolute() is false.

Common situations: Version skew where an older/newer Copilot CLI emits relative paths; a custom HERMES_COPILOT_ACP_COMMAND binary that does not follow the ACP fs path convention. Not typically user-triggerable directly.

Related errors


AI-assisted analysis of NousResearch/hermes-agent@c896c09c42 (2026-08-14). Data as JSON: /api/errors/7418eaca6531cd73. Report an issue: GitHub.