Skip to content

feat(honcho): scope host and peer resolution to active Hermes profile#3999

Closed
erosika wants to merge 10 commits into
NousResearch:mainfrom
erosika:eri/honcho-profile-scoping
Closed

feat(honcho): scope host and peer resolution to active Hermes profile#3999
erosika wants to merge 10 commits into
NousResearch:mainfrom
erosika:eri/honcho-profile-scoping

Conversation

@erosika

@erosika erosika commented Mar 30, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds Honcho identity scoping, cross-profile observability, and zero-friction migration for the multi-profile system (#3681). Each profile becomes an independent Honcho peer with its own workspace, config, and accumulated memory.

Host resolution

  • Profile "coder" resolves to host hermes.coder, reads from hosts["hermes.coder"] in honcho.json
  • Resolution order: HERMES_HONCHO_HOST env var > active profile name > "hermes" (default)
  • from_env() / from_global_config() auto-resolve host, workspace, and aiPeer

Zero-friction migration

  • hermes profile create coder auto-clones Honcho config from default profile: memory mode, recall mode, write frequency, peer name, etc. are inherited; workspace + aiPeer auto-derive from profile name
  • AI and user peers are eagerly created in Honcho at profile creation time (not deferred to first message)
  • No hermes honcho setup needed for new profiles when Honcho is already configured

Enable/disable per profile

  • hermes honcho enable -- turn on Honcho for the active profile, clone settings from default if first time, create peer immediately
  • hermes honcho disable -- turn off Honcho for the active profile
  • Per-profile toggle, not global -- disable Honcho on one profile without affecting others

Observability

  • hermes honcho status shows active profile name + host key
  • hermes honcho status --all -- compact table across all profiles:
    Honcho profiles (3)
    ────────────────────────────────────────────────────────────
      Profile        Host                   Enabled   Mode      Recall    Write
      default        hermes                 yes       hybrid    hybrid    async
      coder *        hermes.coder           yes       honcho    tools     turn
      dreamer        hermes.dreamer         no        hybrid    hybrid    async
    
      * active profile
    
  • hermes honcho peers -- cross-profile peer identity table:
    Honcho peer identities (3 profiles)
    ──────────────────────────────────────────────────
      Profile        User peer        AI peer
      default        eri              hermes
      coder          eri              hermes.coder
      dreamer        eri              hermes.dreamer
    
  • All write commands (peer, mode, tokens) print [host_key] label when operating on a non-default profile

Per-profile config granularity

Each profile's host block is independently configurable:

Setting CLI Scope
Enable/disable hermes honcho enable/disable per-profile
AI peer / user peer hermes honcho peer per-profile
Memory mode hermes honcho mode per-profile
Context tokens / dialectic hermes honcho tokens per-profile
Recall mode config file per-profile
Write frequency config file per-profile
Session strategy config file per-profile

API key and base URL stay at root (shared across profiles).

Changes

  • honcho_integration/client.py -- add resolve_active_host(), thread resolved host through config
  • honcho_integration/cli.py -- clone_honcho_for_profile(), _ensure_peer_exists(), cmd_enable/disable, cmd_peers, cmd_status --all, host labels on writes
  • hermes_cli/main.py -- argparse for new commands, auto-clone hook in profile creation
  • tests/honcho_integration/test_client.py -- 10 new tests for host resolution and profile-scoped config
  • tests/honcho_integration/test_cli.py -- 5 new tests for auto-clone behavior

Complements #3681 (profiles). Supersedes the Honcho portion of #2845.

Test plan

  • pytest tests/honcho_integration/ tests/test_honcho_client_config.py -- 134 passed
  • pytest tests/hermes_cli/test_profiles.py -- 71 passed
  • Full honcho suite (138) + profiles (71) + tools/gateway = 214 passed
  • hermes profile create coder auto-clones Honcho config
  • coder honcho status shows profile context
  • hermes honcho status --all shows table across profiles
  • hermes honcho enable creates peer in Honcho
  • hermes honcho disable flips enabled flag

Part of the Honcho PR map. Builds on #4037. Supersedes Honcho portion of #2845. Complements #3681 (profiles).

erosika added 10 commits March 30, 2026 21:13
Derives the Honcho host key from the active Hermes profile so that each
profile gets its own Honcho host block, workspace, and AI peer identity.

Profile "coder" resolves to host "hermes.coder", reads from
hosts["hermes.coder"] in honcho.json, and defaults workspace + aiPeer
to the derived host name.

Resolution order: HERMES_HONCHO_HOST env var > active profile name >
"hermes" (default).

Complements NousResearch#3681 (profiles) with the Honcho identity layer that was
part of NousResearch#2845 (named instances), adapted to the merged profiles system.
- hermes honcho status: shows active profile name + host key
- hermes honcho status --all: compact table of all profiles with mode,
  recall, write frequency per host block
- hermes honcho peers: cross-profile peer identity table (user peer,
  AI peer, linked hosts)
- All write commands (peer, mode, tokens) print [host_key] label when
  operating on a non-default profile
When a profile is created and Honcho is already configured on the
default host, automatically creates a host block for the new profile
with inherited settings (memory mode, recall mode, write frequency,
peer name, etc.) and auto-derived workspace/aiPeer.

Zero-friction path: hermes profile create coder -> Honcho config
cloned as hermes.coder with all settings inherited.
- Eagerly create AI and user peers in Honcho when a profile is created
  (not deferred to first message). Uses idempotent peer() SDK call.
- hermes honcho enable: turn on Honcho for active profile, clone
  settings from default if first time, create peer immediately
- hermes honcho disable: turn off Honcho for active profile
- _ensure_peer_exists() helper for idempotent peer creation
Profiles inherit the default workspace instead of deriving a separate
one. All profiles see the same user context, sessions, and project
history. Each profile is a different AI peer in a shared space.

Workspace can still be overridden per-profile via config if isolation
is needed.
- hermes honcho --target-profile <name> <command>: target another
  profile's Honcho config without switching profiles. Works with all
  subcommands (status, peer, mode, tokens, enable, disable, etc.)
- hermes honcho status now shows user peer card and AI peer
  representation when connected (fetched live from Honcho API)
- hermes honcho sync: scan all profiles, create missing host blocks
- hermes update: automatically syncs Honcho config to all profiles
  after skill sync (existing users get profile mapping on next update)
- sync_honcho_profiles_quiet() for silent use from update path
- Remove duplicate cmd_sync definition (kept version with error output)
- Fix from_env workspace to stay shared (hermes) not profile-derived
- Add docstring clarifying get_or_create is idempotent in status
- Remove unused import importlib in test
- Fix test assertion for shared workspace in from_env path
- Add 3 tests for sync_honcho_profiles_quiet
@teknium1

teknium1 commented Apr 2, 2026

Copy link
Copy Markdown
Contributor

Merged via PR #4616. All 10 of your commits were cherry-picked onto current main with your authorship preserved in git log. One minor cleanup added on top (removed a redundant local import). Thanks for the thorough profile-scoping work!

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.

2 participants