fix(honcho): allow self-hosted local instances without API key (#3644)
Self-hosted Honcho on localhost doesn't require authentication, but both the activation gates and the SDK client required an API key. Combined fix from three contributor PRs: - Relax all 8 activation gates to accept (api_key OR base_url) as valid credentials (#3482 by @cameronbergh) - Use 'local' placeholder for the SDK client when base_url points to localhost/127.0.0.1/::1 (#3570 by @ygd58) Files changed: run_agent.py (2 gates), cli.py (1 gate), gateway/run.py (1 gate), honcho_integration/cli.py (2 gates), hermes_cli/doctor.py (2 gates), honcho_integration/client.py (SDK). Co-authored-by: cameronbergh <cameronbergh@users.noreply.github.com> Co-authored-by: ygd58 <ygd58@users.noreply.github.com> Co-authored-by: devorun <devorun@users.noreply.github.com>
This commit is contained in:
@@ -270,7 +270,7 @@ def cmd_status(args) -> None:
|
||||
print(f" {peer}: {mode}")
|
||||
print(f" Write freq: {hcfg.write_frequency}")
|
||||
|
||||
if hcfg.enabled and hcfg.api_key:
|
||||
if hcfg.enabled and (hcfg.api_key or hcfg.base_url):
|
||||
print("\n Connection... ", end="", flush=True)
|
||||
try:
|
||||
get_honcho_client(hcfg)
|
||||
@@ -278,7 +278,7 @@ def cmd_status(args) -> None:
|
||||
except Exception as e:
|
||||
print(f"FAILED ({e})\n")
|
||||
else:
|
||||
reason = "disabled" if not hcfg.enabled else "no API key"
|
||||
reason = "disabled" if not hcfg.enabled else "no API key or base URL"
|
||||
print(f"\n Not connected ({reason})\n")
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user