Skip to content

fix(honcho): support local baseUrl-only configuration#2645

Closed
erosika wants to merge 5 commits into
NousResearch:mainfrom
erosika:eri/honcho-base-url-fix
Closed

fix(honcho): support local baseUrl-only configuration#2645
erosika wants to merge 5 commits into
NousResearch:mainfrom
erosika:eri/honcho-base-url-fix

Conversation

@erosika

@erosika erosika commented Mar 23, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes Hermes' local/self-hosted Honcho flow so baseUrl works without requiring a dummy API key.

Changes

  • resolve Honcho baseUrl from host-level and root-level config
  • accept baseUrl, base_url, and baseURL when reading existing config
  • prefer canonical baseUrl when multiple aliases are present in the same config scope
  • allow hermes honcho setup to work with baseUrl-only local/self-hosted setups
  • allow hermes honcho identity to work without an API key when baseUrl is configured
  • make hermes honcho status reflect local/self-hosted setups correctly
  • have hermes honcho setup write hosts.hermes.baseUrl for new config
  • clarify docs around hosted vs local/self-hosted setup
  • document config precedence and add troubleshooting guidance
  • add support links including the Honcho Discord

Why

Hermes already intended to support local/self-hosted Honcho via a base URL, but the implementation and docs had drifted apart.

In practice:

  • some valid config shapes were not being resolved
  • some CLI commands still hard-required an API key
  • the docs did not clearly separate hosted and local/self-hosted setup paths
  • the documented/canonical key shape in ~/.honcho/config.json needed to align with the rest of the file's camelCase style

This made valid local setups appear broken.

Behavior after this change

Hosted Honcho:

  • configure apiKey

Local/self-hosted Honcho:

  • configure baseUrl
  • no API key required

baseUrl is now the canonical documented spelling in ~/.honcho/config.json. base_url and baseURL remain accepted as compatibility aliases when reading existing config. Environment variable support remains HONCHO_BASE_URL.

Test Plan

pytest tests/honcho_integration/test_client.py \
       tests/honcho_integration/test_cli.py \
       tests/test_honcho_client_config.py \
       tests/tools/test_honcho_tools.py \
       tests/gateway/test_honcho_lifecycle.py -q

Result:

  • 69 passed

Related

@erosika

erosika commented Mar 23, 2026

Copy link
Copy Markdown
Contributor Author

A note on scope relative to #2619:

Thanks to @ygd58 for the earlier fix there. This PR is in the same area, but broadens the coverage further so the local/self-hosted baseUrl path is consistent across config resolution, CLI behavior, status output, and docs.

In particular, this branch adds:

  • host-level and root-level baseUrl resolution
  • compatibility aliases base_url / baseURL when reading existing config
  • canonical baseUrl preference when multiple aliases are present in the same config scope
  • honcho status support for baseUrl-only local setups
  • docs cleanup around hosted vs local/self-hosted configuration, precedence, troubleshooting, and support links
  • hermes honcho setup writing hosts.hermes.baseUrl for new config

I switched the canonical documented spelling to baseUrl so it matches the rest of ~/.honcho/config.json's camelCase style. base_url and baseURL are still accepted as compatibility aliases on read, and the Hermes-side environment/config path remains HONCHO_BASE_URL.

@erosika erosika changed the title fix(honcho): support local base_url-only configuration fix(honcho): support local baseUrl-only configuration Mar 26, 2026
@erosika erosika force-pushed the eri/honcho-base-url-fix branch from fcd569b to ea0d9a4 Compare March 26, 2026 18:09
@erosika erosika force-pushed the eri/honcho-base-url-fix branch from ea0d9a4 to 0e12287 Compare March 27, 2026 21:29
@erosika erosika force-pushed the eri/honcho-base-url-fix branch from 60be699 to 72312cb Compare March 30, 2026 17:44
erosika added a commit to erosika/hermes-agent that referenced this pull request Apr 2, 2026
Implements all features from the post-merge Honcho plugin spec:

B1: recall_mode support (context/tools/hybrid)
B2: peer_memory_mode gating (stub for ABC suppression mechanism)
B3: resolve_session_name() session key resolution
B4: first-turn context baking in system_prompt_block()
B5: cost-awareness (cadence, injection frequency, reasoning cap)
B6: memory file migration in initialize()
B7: pre-warming context at init

Ports from open PRs:
- NousResearch#3265: token budget enforcement in prefetch()
- NousResearch#4053: cron guard (skip activation for cron/flush sessions)
- NousResearch#2645: baseUrl-only flow verified in is_available()
- NousResearch#1969: aiPeer sync from SOUL.md
- NousResearch#1957: lazy session init in tools mode

Single file change: plugins/memory/honcho/__init__.py
No modifications to client.py, session.py, or any files outside the plugin.
teknium1 pushed a commit that referenced this pull request Apr 3, 2026
Implements all features from the post-merge Honcho plugin spec:

B1: recall_mode support (context/tools/hybrid)
B2: peer_memory_mode gating (stub for ABC suppression mechanism)
B3: resolve_session_name() session key resolution
B4: first-turn context baking in system_prompt_block()
B5: cost-awareness (cadence, injection frequency, reasoning cap)
B6: memory file migration in initialize()
B7: pre-warming context at init

Ports from open PRs:
- #3265: token budget enforcement in prefetch()
- #4053: cron guard (skip activation for cron/flush sessions)
- #2645: baseUrl-only flow verified in is_available()
- #1969: aiPeer sync from SOUL.md
- #1957: lazy session init in tools mode

Single file change: plugins/memory/honcho/__init__.py
No modifications to client.py, session.py, or any files outside the plugin.
zebster-cmd added a commit to zebster-cmd/hermes-agent that referenced this pull request Apr 7, 2026
)

Ported from erosika's PR NousResearch#2645 to plugin architecture.
- Add _resolve_base_url() helper: checks baseUrl, base_url, baseURL aliases
  with host-level override and env fallback
- Add _has_honcho_credentials() for unified api_key + base_url checks
- Show base URL in 'hermes honcho status' output
- Use _has_honcho_credentials() in identity and migrate commands
- Show both api_key and base_url in migration Step 1
zebster-cmd added a commit to zebster-cmd/hermes-agent that referenced this pull request Apr 7, 2026
…changes for plugin architecture

- Update test_update_autostash.py: tests now expect pull --rebase fallback
  (not reset --hard), and fetch origin main:main for cross-branch updates
  (not checkout main)
- Remove broken honcho test classes (TestHonchoActivation,
  TestHonchoPrefetchScheduling) from test_run_agent.py -- these reference
  old monolithic APIs (HonchoClientConfig, _honcho_prefetch, etc.) that
  moved to the plugin architecture
- Remove broken TestSystemPromptStability honcho methods that reference
  _inject_honcho_turn_context (now in plugin)
- Keep passing TestExtractAgentNameFromSoul tests
- Update test_client.py to expect host-block baseUrl override (PR NousResearch#2645)
@erosika

erosika commented Apr 15, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by #9884 — baseUrl-only and timeout config plumbing included in the plugin rewrite.

@erosika erosika closed this Apr 15, 2026
angelburgosrosado pushed a commit to angelburgosrosado/hermes-agent that referenced this pull request Apr 27, 2026
Implements all features from the post-merge Honcho plugin spec:

B1: recall_mode support (context/tools/hybrid)
B2: peer_memory_mode gating (stub for ABC suppression mechanism)
B3: resolve_session_name() session key resolution
B4: first-turn context baking in system_prompt_block()
B5: cost-awareness (cadence, injection frequency, reasoning cap)
B6: memory file migration in initialize()
B7: pre-warming context at init

Ports from open PRs:
- NousResearch#3265: token budget enforcement in prefetch()
- NousResearch#4053: cron guard (skip activation for cron/flush sessions)
- NousResearch#2645: baseUrl-only flow verified in is_available()
- NousResearch#1969: aiPeer sync from SOUL.md
- NousResearch#1957: lazy session init in tools mode

Single file change: plugins/memory/honcho/__init__.py
No modifications to client.py, session.py, or any files outside the plugin.
02356abc pushed a commit to 02356abc/hermes-agent that referenced this pull request May 14, 2026
Implements all features from the post-merge Honcho plugin spec:

B1: recall_mode support (context/tools/hybrid)
B2: peer_memory_mode gating (stub for ABC suppression mechanism)
B3: resolve_session_name() session key resolution
B4: first-turn context baking in system_prompt_block()
B5: cost-awareness (cadence, injection frequency, reasoning cap)
B6: memory file migration in initialize()
B7: pre-warming context at init

Ports from open PRs:
- NousResearch#3265: token budget enforcement in prefetch()
- NousResearch#4053: cron guard (skip activation for cron/flush sessions)
- NousResearch#2645: baseUrl-only flow verified in is_available()
- NousResearch#1969: aiPeer sync from SOUL.md
- NousResearch#1957: lazy session init in tools mode

Single file change: plugins/memory/honcho/__init__.py
No modifications to client.py, session.py, or any files outside the plugin.
olympus-terminal pushed a commit to olympus-terminal/hermes-agent that referenced this pull request May 16, 2026
Implements all features from the post-merge Honcho plugin spec:

B1: recall_mode support (context/tools/hybrid)
B2: peer_memory_mode gating (stub for ABC suppression mechanism)
B3: resolve_session_name() session key resolution
B4: first-turn context baking in system_prompt_block()
B5: cost-awareness (cadence, injection frequency, reasoning cap)
B6: memory file migration in initialize()
B7: pre-warming context at init

Ports from open PRs:
- NousResearch#3265: token budget enforcement in prefetch()
- NousResearch#4053: cron guard (skip activation for cron/flush sessions)
- NousResearch#2645: baseUrl-only flow verified in is_available()
- NousResearch#1969: aiPeer sync from SOUL.md
- NousResearch#1957: lazy session init in tools mode

Single file change: plugins/memory/honcho/__init__.py
No modifications to client.py, session.py, or any files outside the plugin.
PowerCreek added a commit to TechDevGroup/hermes-agent that referenced this pull request May 23, 2026
…step 2b) (#45)

Step 2b of the RFC #42 migration plan. Honcho already had a real
backend probe inside doctor's elif block (get_honcho_client(hcfg)
since the initial Honcho integration); move it INTO the provider's
health_check() so doctor's generic branch can eventually use the
unified ABC interface (step 3).

Outcomes (RFC #42 reason prefixes):
  (True, "")                    — handshake succeeds
  (False, "no_config")          — honcho.json absent
  (False, "disabled")           — enabled=false in config
  (False, "no_credentials")     — neither api_key nor base_url set
                                  (NousResearch#2645: either one suffices)
  (False, "sdk_missing")        — honcho-ai not installed
  (False, "config_error: ...")  — config parsing itself raised
  (False, "auth: ...")          — 401/403/forbidden/unauthorized/
                                  invalid-api-key/authentication
  (False, "unreachable: ...")   — anything else (network, timeout,
                                  SDK exception)

The "never raises" contract is enforced at every layer — even
when HonchoClientConfig.from_global_config() itself throws,
health_check returns (False, "config_error: <msg>") rather than
propagating.

Doctor's dedicated honcho elif block is NOT touched yet. That
collapses in a follow-up PR (step 3 of #42) once both Honcho and
Mem0 (#44) ship native health_check overrides. Operators see no
behavior change here.

Tests:
  - successful handshake returns (True, "")
  - no_config when honcho.json absent
  - disabled when enabled=false
  - no_credentials when both api_key and base_url empty
  - base_url alone counts as credentials (NousResearch#2645 port)
  - 4 auth-classification cases (401/403/invalid-api-key/auth-failed)
  - ConnectionError → unreachable:
  - never raises: config-parsing exception → (False, "config_error:")
  - long error messages truncated under 220 chars

Continues #42; does not close it. Step 3 (doctor collapse) is
next.
gweeteve pushed a commit to gweeteve/hermes-agent that referenced this pull request Jun 2, 2026
Implements all features from the post-merge Honcho plugin spec:

B1: recall_mode support (context/tools/hybrid)
B2: peer_memory_mode gating (stub for ABC suppression mechanism)
B3: resolve_session_name() session key resolution
B4: first-turn context baking in system_prompt_block()
B5: cost-awareness (cadence, injection frequency, reasoning cap)
B6: memory file migration in initialize()
B7: pre-warming context at init

Ports from open PRs:
- NousResearch#3265: token budget enforcement in prefetch()
- NousResearch#4053: cron guard (skip activation for cron/flush sessions)
- NousResearch#2645: baseUrl-only flow verified in is_available()
- NousResearch#1969: aiPeer sync from SOUL.md
- NousResearch#1957: lazy session init in tools mode

Single file change: plugins/memory/honcho/__init__.py
No modifications to client.py, session.py, or any files outside the plugin.
Egavasyug pushed a commit to Egavasyug/hermes-agent that referenced this pull request Jun 10, 2026
Implements all features from the post-merge Honcho plugin spec:

B1: recall_mode support (context/tools/hybrid)
B2: peer_memory_mode gating (stub for ABC suppression mechanism)
B3: resolve_session_name() session key resolution
B4: first-turn context baking in system_prompt_block()
B5: cost-awareness (cadence, injection frequency, reasoning cap)
B6: memory file migration in initialize()
B7: pre-warming context at init

Ports from open PRs:
- NousResearch#3265: token budget enforcement in prefetch()
- NousResearch#4053: cron guard (skip activation for cron/flush sessions)
- NousResearch#2645: baseUrl-only flow verified in is_available()
- NousResearch#1969: aiPeer sync from SOUL.md
- NousResearch#1957: lazy session init in tools mode

Single file change: plugins/memory/honcho/__init__.py
No modifications to client.py, session.py, or any files outside the plugin.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Local Honcho "base_url" instead of api key does not work

1 participant