NousResearch/hermes-agent · error · RuntimeError
bws returned unexpected shape: {type(payload).__name__}
Error message
bws returned unexpected shape: {type(payload).__name__} What it means
Error "bws returned unexpected shape: {type(payload).__name__}" thrown in NousResearch/hermes-agent.
Source
Thrown at agent/secret_sources/bitwarden.py:727
# dump (color-eyre): an "Error:" header, indented cause lines, then
# "Location:" / "Backtrace omitted" noise. Strip ANSI and boil it
# down to the meaningful cause line(s) before surfacing.
err = _summarize_bws_stderr(proc.stderr or proc.stdout or "")
raise RuntimeError(
f"bws exited {proc.returncode}: {err[:200]}"
)
raw = proc.stdout.strip()
if not raw:
return {}, ["bws returned no output (empty project?)"]
try:
payload = json.loads(raw)
except json.JSONDecodeError as exc:
raise RuntimeError(f"bws returned non-JSON output: {exc}") from exc
if not isinstance(payload, list):
raise RuntimeError(
f"bws returned unexpected shape: {type(payload).__name__}"
)
secrets: Dict[str, str] = {}
warnings: List[str] = []
for item in payload:
if not isinstance(item, dict):
continue
key = item.get("key")
value = item.get("value")
if not isinstance(key, str) or not isinstance(value, str):
continue
if not _is_valid_env_name(key):
warnings.append(
f"Skipping secret {key!r}: not a valid env-var name"
)
continue
secrets[key] = valueView on GitHub (pinned to c896c09c42)
Solutions
- Check the bws version matches what Hermes expects; the response shape was unexpected.
- Run the bws command manually and compare its JSON structure.
When it happens
Trigger: Thrown at agent/secret_sources/bitwarden.py:727 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of NousResearch/hermes-agent@c896c09c42 (2026-08-14).
Data as JSON: /api/errors/1f02a5b5e7dfed41.
Report an issue: GitHub.