Compare commits

...

2 Commits

Author SHA1 Message Date
Alexander Whitestone
a528bd5b1b fix: use .get() for env_vars key in _show_tool_availability_warnings
Some checks failed
Docker Build and Publish / build-and-push (pull_request) Has been skipped
Supply Chain Audit / Scan PR for supply chain risks (pull_request) Successful in 24s
Tests / test (pull_request) Failing after 1h2m1s
Tests / e2e (pull_request) Successful in 1m38s
Fixes KeyError: 'missing_vars' crash on CLI startup when toolsets are
unavailable. registry.py returns dicts with 'env_vars' key, but
_show_tool_availability_warnings() was accessing 'missing_vars' directly.

Now uses .get("env_vars") or .get("missing_vars") to handle both key
names, consistent with how doctor.py already handles this.

Fixes #834

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-16 01:23:48 -04:00
Alexander Whitestone
6b40c5db7a fix: use env_vars key in _show_tool_availability_warnings to prevent KeyError
registry.py:check_tool_availability() returns unavailable dicts with key
"env_vars", but _show_tool_availability_warnings() in cli.py was accessing
u["missing_vars"] causing a KeyError crashing CLI startup whenever any
toolset was disabled.

Fix matches how doctor.py already handles the same data.

Fixes #834
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-16 00:42:03 -04:00

7
cli.py
View File

@@ -3611,8 +3611,8 @@ class HermesCLI:
available, unavailable = check_tool_availability()
# Filter to only those missing API keys (not system deps)
api_key_missing = [u for u in unavailable if u["missing_vars"]]
api_key_missing = [u for u in unavailable if u.get("env_vars") or u.get("missing_vars")]
if api_key_missing:
self.console.print()
self.console.print("[yellow]⚠️ Some tools disabled (missing API keys):[/]")
@@ -3620,7 +3620,8 @@ class HermesCLI:
tools_str = ", ".join(item["tools"][:2]) # Show first 2 tools
if len(item["tools"]) > 2:
tools_str += f", +{len(item['tools'])-2} more"
self.console.print(f" [dim]• {item['name']}[/] [dim italic]({', '.join(item['missing_vars'])})[/]")
env_vars = item.get("env_vars") or item.get("missing_vars") or []
self.console.print(f" [dim]• {item['name']}[/] [dim italic]({', '.join(env_vars)})[/]")
self.console.print("[dim] Run 'hermes setup' to configure[/]")
except Exception:
pass # Don't crash on import errors