Skip to content

fix(honcho): plugin drift overhaul + feat(plugins): CLI registration system#5295

Merged
teknium1 merged 5 commits into
mainfrom
hermes/hermes-8e46c8ba
Apr 5, 2026
Merged

fix(honcho): plugin drift overhaul + feat(plugins): CLI registration system#5295
teknium1 merged 5 commits into
mainfrom
hermes/hermes-8e46c8ba

Conversation

@teknium1

@teknium1 teknium1 commented Apr 5, 2026

Copy link
Copy Markdown
Contributor

Summary

Salvages PR #5045 (by erosika) and adds a plugin CLI registration system that decouples plugin commands from the core codebase. Existing users are protected by a migration guard for the observation mode default change.

Commit 1: fix(honcho) — Salvaged from PR #5045 (erosika)

Honcho memory plugin overhaul addressing integration drift since the v0.7 plugin migration:

Fixes:

  • base_url/baseUrl config mismatch for self-hosted setups
  • Local auth leak — cloud API keys no longer sent to local Honcho instances
  • Setup command conflation — converges via post_setup() hook in memory_setup.py
  • Peer card/profile reads now use direct peer APIs instead of session-scoped context()

New features:

  • Message chunking for Honcho API limits (25k chars default, configurable)
  • Dialectic input guard (10k chars, configurable)
  • Granular per-peer observation config (observeMe/observeOthers booleans)
  • Server-side observation sync via get_peer_configuration()
  • dialecticDynamic toggle, cloud/local deployment picker in setup wizard

Dead code removed: memoryMode, peer_memory_modes, linkedHosts, suppress flags, SOUL.md aiPeer sync

Docs: Comprehensive README, new optional skill, expanded memory-providers.md

Tests: 9 new (chunking, dialectic guard, peer lookups), 14 dead removed, 2 pre-existing fixes

Commit 2: feat(plugins) — Plugin CLI registration system

Adds ctx.register_cli_command() to PluginContext and discover_plugin_cli_commands() to the memory plugin system. Plugins provide a register_cli(subparser) function in their cli.py — discovered at argparse setup time, no core file changes needed.

  • Removes 95-line hardcoded honcho argparse block from main.py
  • Moves honcho subcommand tree entirely into plugins/memory/honcho/cli.py
  • hermes honcho setup redirects to hermes memory setup (unified path)

Commit 3: Tests for plugin CLI registration (12 tests)

Commit 4: Active-provider gating

Plugin CLI commands only appear for the active memory.provider. No provider configured = no plugin CLI commands in help output. Prevents disabled plugins from cluttering the CLI.

Commit 5: Migration guard for observation mode default

Existing configs without explicit observationMode keep "unified" (old default). New installations get "directional" (all observations on). Detection uses _explicitly_configured flag (host block exists or enabled=true). 5 tests covering all migration paths.

Stripped from PR #5045

  • gateway/platforms/matrix.py (unrelated nio defensive fix)
  • tools/skill_manager_tool.py (unrelated _find_skill refactor)
  • tests/tools/test_browser_camofox_state.py (unrelated config version assertion)
  • hermes_cli/main.py direct honcho setup change (replaced by plugin CLI registration)

Test results

  • tests/honcho_plugin/ — 123 passed
  • tests/test_plugin_cli_registration.py — 12 passed
  • tests/test_plugins.py + test_plugins_cmd.py — 65 passed
  • Zero regressions (all failures pre-existing on main)

Closes on merge

PRs: #1969, #2645, #3265, #3425, #4053, #4632, #4642, #5045, #5061, #5137, #5184, #5231
Issues: #2613, #3422, #3555, #4296

erosika and others added 3 commits April 5, 2026 12:03
…etup wizard, docs, dead code cleanup

Salvaged from PR #5045 by erosika.

- Replace memoryMode/peer_memory_modes with granular per-peer observation config
- Add message chunking for Honcho API limits (25k chars default)
- Add dialectic input guard (10k chars default)
- Add dialecticDynamic toggle for reasoning level auto-bump
- Rewrite setup wizard with cloud/local deployment picker
- Switch peer card/profile/search from session.context() to direct peer APIs
- Add server-side observation sync via get_peer_configuration()
- Fix base_url/baseUrl config mismatch for self-hosted setups
- Fix local auth leak (cloud API keys no longer sent to local instances)
- Remove dead code: memoryMode, peer_memory_modes, linkedHosts, suppress flags, SOUL.md aiPeer sync
- Add post_setup hook to memory_setup.py for provider-specific setup wizards
- Comprehensive README rewrite with full config reference
- New optional skill: autonomous-ai-agents/honcho
- Expanded memory-providers.md with multi-profile docs
- 9 new tests (chunking, dialectic guard, peer lookups), 14 dead tests removed
- Fix 2 pre-existing TestResolveConfigPath filesystem isolation failures
…nds from core

Add ctx.register_cli_command() to PluginContext for general plugins and
discover_plugin_cli_commands() to memory plugin system. Plugins that
provide a register_cli(subparser) function in their cli.py are
automatically discovered during argparse setup and wired into the CLI.

- Remove 95-line hardcoded honcho argparse block from main.py
- Move honcho subcommand tree into plugins/memory/honcho/cli.py
  via register_cli() convention
- hermes honcho setup now redirects to hermes memory setup (unified path)
- hermes honcho (no subcommand) shows status instead of running setup
- Future plugins can register CLI commands without touching core files
- PluginManager stores CLI registrations in _cli_commands dict
- Memory plugin discovery scans cli.py for register_cli at argparse time

main.py: -102 lines of hardcoded plugin routing
11 tests covering:
- PluginContext.register_cli_command() storage and overwrite
- get_plugin_cli_commands() return semantics
- Memory plugin discover_plugin_cli_commands() with register_cli convention
- Skipping plugins without register_cli or cli.py
- Honcho register_cli() subcommand tree structure
- Mode choices updated to recall modes (hybrid/context/tools)
- _ProviderCollector.register_cli_command no-op safety
@github-actions

github-actions Bot commented Apr 5, 2026

Copy link
Copy Markdown
Contributor

⚠️ Supply Chain Risk Detected

This PR contains patterns commonly associated with supply chain attacks. This does not mean the PR is malicious — but these patterns require careful human review before merging.

⚠️ WARNING: Install hook files modified

These files can execute code during package installation or interpreter startup.

Files:

hermes_cli/memory_setup.py

Automated scan triggered by supply-chain-audit. If this is a false positive, a maintainer can approve after manual review.

discover_plugin_cli_commands() now reads memory.provider from config.yaml
and only loads CLI registration for the active provider. If no memory
provider is set, no plugin CLI commands appear in the CLI.

Only one memory provider can be active at a time — at most one set of
plugin CLI commands is registered. Users who haven't configured honcho
(or any memory provider) won't see 'hermes honcho' in their help output.

Adds test for inactive provider returning empty results.
@github-actions

github-actions Bot commented Apr 5, 2026

Copy link
Copy Markdown
Contributor

⚠️ Supply Chain Risk Detected

This PR contains patterns commonly associated with supply chain attacks. This does not mean the PR is malicious — but these patterns require careful human review before merging.

⚠️ WARNING: Install hook files modified

These files can execute code during package installation or interpreter startup.

Files:

hermes_cli/memory_setup.py

Automated scan triggered by supply-chain-audit. If this is a false positive, a maintainer can approve after manual review.

Existing honcho.json configs without an explicit observationMode now
default to 'unified' (the old default) instead of being silently
switched to 'directional'. New installations get 'directional' as
the new default.

Detection: _explicitly_configured (host block exists or enabled=true)
signals an existing config. When true and no observationMode is set
anywhere in the config chain, falls back to 'unified'. When false
(fresh install), uses 'directional'.

Users who explicitly set observationMode or granular observation
booleans are unaffected — explicit config always wins.

5 new tests covering all migration paths.
@github-actions

github-actions Bot commented Apr 5, 2026

Copy link
Copy Markdown
Contributor

⚠️ Supply Chain Risk Detected

This PR contains patterns commonly associated with supply chain attacks. This does not mean the PR is malicious — but these patterns require careful human review before merging.

⚠️ WARNING: Install hook files modified

These files can execute code during package installation or interpreter startup.

Files:

hermes_cli/memory_setup.py

Automated scan triggered by supply-chain-audit. If this is a false positive, a maintainer can approve after manual review.

@teknium1 teknium1 merged commit 583d9f9 into main Apr 5, 2026
6 of 7 checks passed
teknium1 added a commit that referenced this pull request Apr 5, 2026
Post PR #5295 docs audit — 4 fixes:

1. cli-commands.md: Update hermes honcho subcommand table with 4
   missing commands (peers, enable, disable, sync), --target-profile
   flag, --all on status, correct mode values (hybrid/context/tools
   not hybrid/honcho/local), and note that setup redirects to
   hermes memory setup.

2. build-a-hermes-plugin.md: Replace 'ctx.register_command() —
   planned but not yet implemented' with the actual implemented
   ctx.register_cli_command() API. Add full Register CLI commands
   section with code example.

3. memory-provider-plugin.md: Add 'Adding CLI Commands' section
   documenting the register_cli(subparser) convention for memory
   provider plugins, active-provider gating, and directory structure.

4. plugins.md: Add CLI command registration to the capabilities table.
teknium1 added a commit that referenced this pull request Apr 5, 2026
…5308)

Post PR #5295 docs audit — 4 fixes:

1. cli-commands.md: Update hermes honcho subcommand table with 4
   missing commands (peers, enable, disable, sync), --target-profile
   flag, --all on status, correct mode values (hybrid/context/tools
   not hybrid/honcho/local), and note that setup redirects to
   hermes memory setup.

2. build-a-hermes-plugin.md: Replace 'ctx.register_command() —
   planned but not yet implemented' with the actual implemented
   ctx.register_cli_command() API. Add full Register CLI commands
   section with code example.

3. memory-provider-plugin.md: Add 'Adding CLI Commands' section
   documenting the register_cli(subparser) convention for memory
   provider plugins, active-provider gating, and directory structure.

4. plugins.md: Add CLI command registration to the capabilities table.
@kevin-ho

kevin-ho commented Apr 6, 2026

Copy link
Copy Markdown

Heads up -- this PR's rename of memory_moderecall_mode missed hermes_cli/doctor.py:839. It still references hcfg.memory_mode, which causes hermes doctor to throw an AttributeError when Honcho is the memory provider. Quick fix: hcfg.memory_modehcfg.recall_mode on that line.

Tommyeds pushed a commit to Tommyeds/hermes-agent that referenced this pull request Apr 12, 2026
…ousResearch#5308)

Post PR NousResearch#5295 docs audit — 4 fixes:

1. cli-commands.md: Update hermes honcho subcommand table with 4
   missing commands (peers, enable, disable, sync), --target-profile
   flag, --all on status, correct mode values (hybrid/context/tools
   not hybrid/honcho/local), and note that setup redirects to
   hermes memory setup.

2. build-a-hermes-plugin.md: Replace 'ctx.register_command() —
   planned but not yet implemented' with the actual implemented
   ctx.register_cli_command() API. Add full Register CLI commands
   section with code example.

3. memory-provider-plugin.md: Add 'Adding CLI Commands' section
   documenting the register_cli(subparser) convention for memory
   provider plugins, active-provider gating, and directory structure.

4. plugins.md: Add CLI command registration to the capabilities table.
angelburgosrosado pushed a commit to angelburgosrosado/hermes-agent that referenced this pull request Apr 27, 2026
…ousResearch#5308)

Post PR NousResearch#5295 docs audit — 4 fixes:

1. cli-commands.md: Update hermes honcho subcommand table with 4
   missing commands (peers, enable, disable, sync), --target-profile
   flag, --all on status, correct mode values (hybrid/context/tools
   not hybrid/honcho/local), and note that setup redirects to
   hermes memory setup.

2. build-a-hermes-plugin.md: Replace 'ctx.register_command() —
   planned but not yet implemented' with the actual implemented
   ctx.register_cli_command() API. Add full Register CLI commands
   section with code example.

3. memory-provider-plugin.md: Add 'Adding CLI Commands' section
   documenting the register_cli(subparser) convention for memory
   provider plugins, active-provider gating, and directory structure.

4. plugins.md: Add CLI command registration to the capabilities table.
angelburgosrosado pushed a commit to angelburgosrosado/hermes-agent that referenced this pull request Apr 28, 2026
Post PR NousResearch#5295 docs audit — 4 fixes:

1. cli-commands.md: Update hermes honcho subcommand table with 4
   missing commands (peers, enable, disable, sync), --target-profile
   flag, --all on status, correct mode values (hybrid/context/tools
   not hybrid/honcho/local), and note that setup redirects to
   hermes memory setup.

2. build-a-hermes-plugin.md: Replace 'ctx.register_command() —
   planned but not yet implemented' with the actual implemented
   ctx.register_cli_command() API. Add full Register CLI commands
   section with code example.

3. memory-provider-plugin.md: Add 'Adding CLI Commands' section
   documenting the register_cli(subparser) convention for memory
   provider plugins, active-provider gating, and directory structure.

4. plugins.md: Add CLI command registration to the capabilities table.
02356abc pushed a commit to 02356abc/hermes-agent that referenced this pull request May 14, 2026
…ousResearch#5308)

Post PR NousResearch#5295 docs audit — 4 fixes:

1. cli-commands.md: Update hermes honcho subcommand table with 4
   missing commands (peers, enable, disable, sync), --target-profile
   flag, --all on status, correct mode values (hybrid/context/tools
   not hybrid/honcho/local), and note that setup redirects to
   hermes memory setup.

2. build-a-hermes-plugin.md: Replace 'ctx.register_command() —
   planned but not yet implemented' with the actual implemented
   ctx.register_cli_command() API. Add full Register CLI commands
   section with code example.

3. memory-provider-plugin.md: Add 'Adding CLI Commands' section
   documenting the register_cli(subparser) convention for memory
   provider plugins, active-provider gating, and directory structure.

4. plugins.md: Add CLI command registration to the capabilities table.
olympus-terminal pushed a commit to olympus-terminal/hermes-agent that referenced this pull request May 16, 2026
…ousResearch#5308)

Post PR NousResearch#5295 docs audit — 4 fixes:

1. cli-commands.md: Update hermes honcho subcommand table with 4
   missing commands (peers, enable, disable, sync), --target-profile
   flag, --all on status, correct mode values (hybrid/context/tools
   not hybrid/honcho/local), and note that setup redirects to
   hermes memory setup.

2. build-a-hermes-plugin.md: Replace 'ctx.register_command() —
   planned but not yet implemented' with the actual implemented
   ctx.register_cli_command() API. Add full Register CLI commands
   section with code example.

3. memory-provider-plugin.md: Add 'Adding CLI Commands' section
   documenting the register_cli(subparser) convention for memory
   provider plugins, active-provider gating, and directory structure.

4. plugins.md: Add CLI command registration to the capabilities table.
deestax pushed a commit to T3-Venture-Labs-Limited/hermes-agent that referenced this pull request May 20, 2026
…mAdapter

Adds BasePlatformAdapter.build_delivery_metadata(job, status_hint,
base_metadata) — an optional polymorphic hook subclasses override to
enrich the metadata kwarg passed to adapter.send() during cron
delivery. Default returns base_metadata unchanged (or {} when None).

cron/scheduler.py:_deliver_result now calls
adapter.build_delivery_metadata(...) on the resolved runtime adapter
instead of constructing send_metadata inline. Adds a status_hint
parameter to _deliver_result (default 'ok', set to 'error' by tick()
on failed runs) that flows through the hook. The call is exception-
guarded — misbehaving overrides log a warning and fall back to
base_metadata, mirroring _run_processing_hook's safety pattern.

Today the scheduler builds send_metadata as a plain {'thread_id': ...}
dict. Platform adapters that need richer delivery context have no
way to attach metadata without patching the scheduler. This hook
provides the missing extension surface, mirroring the existing
on_processing_start / on_processing_complete optional-method pattern
on BasePlatformAdapter.

Each of the following becomes a one-method override once the hook
lands, instead of a scheduler-touching PR:

- Webhook-fallback adapters needing job_id, job_name, status, ran_at
  to reconstruct delivery context when no live connection is available
- Audit-logging adapters needing trace_id, user_id, severity
- Multi-tenant adapters (CRM bridges, issue trackers) needing
  tenant_id, account_id, project_id, lead_id
- Telegram cron-into-topic-threads via message_thread_id
- Discord cron-into-forum-channels via applied_tags, or
  cron-into-thread via thread_id
- Slack cron-into-thread via thread_ts; @-mention via user_id
- Matrix E2EE flags; m.in_reply_to reply chaining
- Email In-Reply-To/References headers for threading
- WhatsApp template-message metadata for compliance-gated channels
- Home Assistant action-button payloads; voice-assistant routing
- SMS delivery-receipt requests; sender-ID overrides

None of these are in scope here; the PR is strictly additive with
the no-op default. Listed as evidence that the missing extension
point is broadly applicable.

Follows the same pattern as NousResearch#5295 (removed 95 lines of hardcoded
honcho argparse from main.py): replace platform-specific logic in
core with an optional hook on a base class.

Backward compatible. Every shipped adapter (Telegram, Discord, Slack,
WhatsApp, Signal, Matrix, Mattermost, Email, SMS, Home Assistant,
DingTalk, Feishu, WeCom, Weixin, BlueBubbles, QQ) inherits the no-op
default and produces a byte-identical send_metadata payload. The new
status_hint parameter is keyword-only with a default, so existing
_deliver_result callers work unchanged.

Tests:
- tests/gateway/test_build_delivery_metadata.py: 5 new unit tests for
  the default hook (no-op behavior, missing base_metadata, copy
  semantics, signature stability, status_hint agnosticism).
- tests/cron/test_scheduler.py: 5 existing tests gain a one-line mock
  of the new method on their AsyncMock/MagicMock adapters (the new
  method is part of the BasePlatformAdapter contract, so test mocks
  need it too).
- Focused suite (tests/gateway/test_build_delivery_metadata.py +
  tests/cron/test_scheduler.py): 132/132 passing.

Docs:
- website/docs/developer-guide/adding-platform-adapters.md: new
  "Enriching delivery metadata" subsection under "Cron Delivery"
  with override template and behavior contract.
- website/docs/developer-guide/cron-internals.md: new "Adapter
  Metadata Enrichment" subsection under "Delivery Model" with a
  cross-reference to the adapter-author guide.
deestax pushed a commit to T3-Venture-Labs-Limited/hermes-agent that referenced this pull request May 20, 2026
Adds BasePlatformAdapter.build_delivery_metadata(job, status_hint,
base_metadata) so adapters can enrich the metadata passed to
adapter.send() during cron delivery without patching the scheduler.
cron/scheduler.py:_deliver_result calls the hook on the resolved
runtime adapter instead of constructing send_metadata inline.

Mirrors the existing on_processing_start / on_processing_complete
optional-method pattern on BasePlatformAdapter. Same shape as NousResearch#5295
(removed hardcoded honcho argparse from main.py): platform-specific
logic moves out of core into adapter overrides.

The default returns base_metadata unchanged (or None when None), so
all shipped adapters remain byte-identical. The hook fires only on
the live-runtime-adapter delivery path; standalone_sender_fn is
unchanged. Hook exceptions are caught and fall back to base_metadata,
matching _run_processing_hook's pattern.

Tests: 5 unit tests for the default hook + 3 integration tests for
the scheduler path (hook called and result reaches send; exception
fallback; tick() forwards status_hint='error'). Focused suite 135/135.

Docs: adding-platform-adapters.md gains "Enriching delivery metadata"
with an override template; cron-internals.md gains "Adapter Metadata
Enrichment" with a cross-reference.
gweeteve pushed a commit to gweeteve/hermes-agent that referenced this pull request Jun 2, 2026
…ousResearch#5308)

Post PR NousResearch#5295 docs audit — 4 fixes:

1. cli-commands.md: Update hermes honcho subcommand table with 4
   missing commands (peers, enable, disable, sync), --target-profile
   flag, --all on status, correct mode values (hybrid/context/tools
   not hybrid/honcho/local), and note that setup redirects to
   hermes memory setup.

2. build-a-hermes-plugin.md: Replace 'ctx.register_command() —
   planned but not yet implemented' with the actual implemented
   ctx.register_cli_command() API. Add full Register CLI commands
   section with code example.

3. memory-provider-plugin.md: Add 'Adding CLI Commands' section
   documenting the register_cli(subparser) convention for memory
   provider plugins, active-provider gating, and directory structure.

4. plugins.md: Add CLI command registration to the capabilities table.
Egavasyug pushed a commit to Egavasyug/hermes-agent that referenced this pull request Jun 10, 2026
…ousResearch#5308)

Post PR NousResearch#5295 docs audit — 4 fixes:

1. cli-commands.md: Update hermes honcho subcommand table with 4
   missing commands (peers, enable, disable, sync), --target-profile
   flag, --all on status, correct mode values (hybrid/context/tools
   not hybrid/honcho/local), and note that setup redirects to
   hermes memory setup.

2. build-a-hermes-plugin.md: Replace 'ctx.register_command() —
   planned but not yet implemented' with the actual implemented
   ctx.register_cli_command() API. Add full Register CLI commands
   section with code example.

3. memory-provider-plugin.md: Add 'Adding CLI Commands' section
   documenting the register_cli(subparser) convention for memory
   provider plugins, active-provider gating, and directory structure.

4. plugins.md: Add CLI command registration to the capabilities table.
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.

3 participants