NousResearch/hermes-agent · error · RuntimeError

Copilot ACP {method} failed: {err.get('message') or err}

Error message

Copilot ACP {method} failed: {err.get('message') or err}

What it means

A JSON-RPC request to the Copilot ACP process returned an error response: the reply message contained an 'error' object, and this RuntimeError surfaces its message (or the raw error). It indicates the Copilot CLI itself rejected the request — e.g. initialize/session/prompt failed server-side — rather than a transport failure.

Source

Thrown at agent/copilot_acp_client.py:596

                    msg = inbox.get(timeout=0.1)
                except queue.Empty:
                    continue

                if self._handle_server_message(
                    msg,
                    process=proc,
                    cwd=self._acp_cwd,
                    text_parts=text_parts,
                    reasoning_parts=reasoning_parts,
                ):
                    continue

                if msg.get("id") != request_id:
                    continue
                if "error" in msg:
                    err = msg.get("error") or {}
                    raise RuntimeError(
                        f"Copilot ACP {method} failed: {err.get('message') or err}"
                    )
                return msg.get("result")

            stderr_text = "\n".join(stderr_tail).strip()
            if proc.poll() is not None and stderr_text:
                if _is_gh_copilot_deprecation_message(stderr_text):
                    raise RuntimeError(
                        "Hermes ACP mode requires the NEW GitHub Copilot CLI "
                        "(github.com/github/copilot-cli), but the binary it just "
                        "spawned is the deprecated `gh copilot` extension.\n\n"
                        "Install the new CLI:\n"
                        "  npm install -g @github/copilot\n"
                        "  # then verify with: copilot --help\n\n"
                        "If `copilot` already resolves to the new CLI but you still see this,\n"
                        "point Hermes at it explicitly:\n"
                        "  export HERMES_COPILOT_ACP_COMMAND=/path/to/new/copilot\n\n"
                        "Alternative: use the `copilot` provider (no ACP, hits the Copilot API\n"
                        "directly with a Copilot subscription token) via `hermes setup`.\n\n"

View on GitHub (pinned to c896c09c42)

Solutions

  1. Read the embedded error message — it comes straight from the Copilot CLI and names the actual cause.
  2. Sign in / refresh Copilot auth (copilot auth login or the CLI's login flow) and retry.
  3. Update the Copilot CLI (npm install -g @github/copilot) to resolve protocol/version mismatches.
  4. If the error persists, capture ~/.hermes/logs output and report with the exact ACP error text.
Defensive patterns

Strategy: try-catch

Try / catch

try:
    result = client._request('session/prompt', {...})
except RuntimeError as e:
    if 'ACP' in str(e) and 'failed' in str(e):
        # message embeds the CLI's own error — branch on auth vs protocol
        ...

Prevention

When it happens

Trigger: Any _request(method, ...) call — 'initialize', 'session/new', 'session/prompt' — whose matching-id response has an 'error' field. Typical causes: unsupported protocol version, invalid session id, Copilot authentication/entitlement failure, malformed prompt payload.

Common situations: Copilot CLI not signed in or lacking an entitlement; version mismatch between Hermes' ACP expectations and the installed CLI; an expired/kicked session id reused after the process restarted.

Related errors


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