fix(honcho): plugin drift overhaul + feat(plugins): CLI registration system#5295
Conversation
…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
|
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.
|
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.
|
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.
…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.
|
Heads up -- this PR's rename of |
…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.
…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.
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.
…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.
…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.
…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.
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.
…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.
…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.
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/baseUrlconfig mismatch for self-hosted setupspost_setup()hook in memory_setup.pycontext()New features:
observeMe/observeOthersbooleans)get_peer_configuration()dialecticDynamictoggle, cloud/local deployment picker in setup wizardDead code removed:
memoryMode,peer_memory_modes,linkedHosts, suppress flags, SOUL.md aiPeer syncDocs: 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()toPluginContextanddiscover_plugin_cli_commands()to the memory plugin system. Plugins provide aregister_cli(subparser)function in theircli.py— discovered at argparse setup time, no core file changes needed.main.pyplugins/memory/honcho/cli.pyhermes honcho setupredirects tohermes 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
observationModekeep"unified"(old default). New installations get"directional"(all observations on). Detection uses_explicitly_configuredflag (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.pydirect honcho setup change (replaced by plugin CLI registration)Test results
tests/honcho_plugin/— 123 passedtests/test_plugin_cli_registration.py— 12 passedtests/test_plugins.py + test_plugins_cmd.py— 65 passedCloses on merge
PRs: #1969, #2645, #3265, #3425, #4053, #4632, #4642, #5045, #5061, #5137, #5184, #5231
Issues: #2613, #3422, #3555, #4296