Skip to content

fix(honcho): enforce local mode semantics and preserve gateway session writes#831

Closed
adavyas wants to merge 10 commits into
NousResearch:mainfrom
adavyas:codex/pr-736-direct
Closed

fix(honcho): enforce local mode semantics and preserve gateway session writes#831
adavyas wants to merge 10 commits into
NousResearch:mainfrom
adavyas:codex/pr-736-direct

Conversation

@adavyas

@adavyas adavyas commented Mar 10, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

This PR addresses two correctness issues in the Honcho integration introduced in pr-#736:

  1. It enforces memoryMode=local at runtime so that Hermes does not initialize or prewarm remote Honcho when both active peers are configured as local.
  2. It preserves Honcho session-scoped write semantics in the gateway by reusing a persistent Honcho manager across request-scoped AIAgent instances for the same gateway session.

Related Issue

Follow-up to #736

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Security fix
  • Documentation update
  • Tests (adding or improving test coverage)
  • Refactor (no behavior change)
  • New skill (bundled or hub)

Changes Made

  • Updated run_agent.py to:
    • treat memoryMode=local as a real runtime disablement for remote Honcho activation when both active peers resolve to local
    • support injection of an existing Honcho manager/config from the gateway
    • keep first-turn prompt warmup cache-safe by avoiding dynamic Honcho dialectic prewarm in the cached prompt path
  • Updated gateway/run.py to:
    • persist Honcho managers per gateway session key
    • reuse those managers across short-lived request handlers
    • shut them down at real gateway session boundaries instead of per request
  • Added regression tests in tests/test_run_agent.py for:
    • memoryMode=local skipping Honcho activation
    • injected Honcho managers bypassing fresh client initialization
  • Added regression tests in tests/gateway/test_honcho_lifecycle.py for:
    • gateway Honcho manager reuse across requests
    • local mode skipping gateway Honcho manager creation
    • session reset shutting down the persistent manager

How to Test

  1. Configure Hermes with Honcho enabled and set both active peers to memoryMode=local.
  2. Run a Hermes session and verify that remote Honcho is not initialized or prewarmed.
  3. Start the gateway and send multiple messages in the same session; verify that the same Honcho manager is reused and only shut down at the gateway session boundary.

Validation run for this branch:

  1. pytest tests/ -q
  2. pytest tests/test_run_agent.py -q
  3. pytest tests/gateway/test_honcho_lifecycle.py -q
  4. python -m hermes_cli.main doctor
  5. python -m hermes_cli.main config check
  6. python -m hermes_cli.main chat -q "test message"

Checklist

Code

  • I've read the Contributing Guide
  • My commit messages follow Conventional Commits (fix(scope):, feat(scope):, etc.)
  • I searched for existing PRs to make sure this isn't a duplicate
  • My PR contains only changes related to this fix/feature (no unrelated commits)
  • I've run pytest tests/ -q and all tests pass
  • I've added tests for my changes (required for bug fixes, strongly encouraged for features)
  • I've tested on my platform: macOS

Documentation & Housekeeping

  • N/A: no user-facing documentation changes were required
  • N/A: no config keys changed, so cli-config.yaml.example did not require updates
  • N/A: no contributor workflow or architecture guide changes were required
  • I've considered cross-platform impact per the compatibility guide
  • N/A: no tool schema or description changes were required

Screenshots / Logs

Test summary:

  • pytest tests/ -q -> 2692 passed, 5 skipped, 23 deselected

Commits included:

  • 7ffaaa0 fix(honcho): enforce local mode and cache-safe warmup
  • 353a9e7 fix(gateway): persist Honcho managers across session requests

erosika and others added 10 commits March 9, 2026 16:13
…allMode

Adds full Honcho memory integration to Hermes:

- Session manager with async background writes, memory modes (honcho/hybrid/local),
  and dialectic prefetch for first-turn context warming
- Agent integration: prefetch pipeline, tool surface gated by recallMode,
  system prompt context injection, SIGTERM/SIGINT flush handlers
- CLI commands: setup, status, mode, tokens, peer, identity, migrate
- recallMode setting (auto | context | tools) for A/B testing retrieval strategies
- Session strategies: per-session, per-repo (git tree root), per-directory, global
- Polymorphic memoryMode config: string shorthand or per-peer object overrides
- 97 tests covering async writes, client config, session resolution, and memory modes
Tell users to go to app.honcho.dev > Settings > API Keys.
Updated in setup walkthrough, setup prompt, and client error message.
Explain what context vs dialectic actually do in plain language:
context = raw memory retrieval, dialectic = AI-to-AI inference
for session continuity. Describe what user/AI peer cards are.
Matches the mental model: hybrid = context + tools,
context = context only, tools = tools only.
New tool lets Hermes persist conclusions about the user (preferences,
corrections, project context) directly to Honcho via the conclusions
API. Feeds into the user's peer card and representation.
Consistent naming: all honcho tools now prefixed with honcho_
(honcho_context, honcho_search, honcho_profile, honcho_conclude).
Optional 'peer' parameter: "user" (default) or "ai". Allows asking
about the AI assistant's history/identity, not just the user's.
@adavyas adavyas changed the title Codex/pr 736 direct fix(honcho): enforce local mode semantics and preserve gateway session writes Mar 10, 2026
@adavyas adavyas closed this Mar 10, 2026
@adavyas adavyas deleted the codex/pr-736-direct branch March 10, 2026 09:53
teknium1 added a commit that referenced this pull request Mar 13, 2026
…e integration, setup CLI

Authored by erosika. Builds on #38 and #243.

Adds async write support, configurable memory modes, context prefetch pipeline,
4 new Honcho tools (honcho_context, honcho_profile, honcho_search, honcho_conclude),
full 'hermes honcho' CLI, session strategies, AI peer identity, recallMode A/B,
gateway lifecycle management, and comprehensive docs.

Cherry-picks fixes from PRs #831/#832 (adavyas).

Co-authored-by: erosika <erosika@users.noreply.github.com>
Co-authored-by: adavyas <adavyas@users.noreply.github.com>
angelburgosrosado pushed a commit to angelburgosrosado/hermes-agent that referenced this pull request Apr 27, 2026
…session title integration, setup CLI

Authored by erosika. Builds on NousResearch#38 and NousResearch#243.

Adds async write support, configurable memory modes, context prefetch pipeline,
4 new Honcho tools (honcho_context, honcho_profile, honcho_search, honcho_conclude),
full 'hermes honcho' CLI, session strategies, AI peer identity, recallMode A/B,
gateway lifecycle management, and comprehensive docs.

Cherry-picks fixes from PRs NousResearch#831/NousResearch#832 (adavyas).

Co-authored-by: erosika <erosika@users.noreply.github.com>
Co-authored-by: adavyas <adavyas@users.noreply.github.com>
02356abc pushed a commit to 02356abc/hermes-agent that referenced this pull request May 14, 2026
…session title integration, setup CLI

Authored by erosika. Builds on NousResearch#38 and NousResearch#243.

Adds async write support, configurable memory modes, context prefetch pipeline,
4 new Honcho tools (honcho_context, honcho_profile, honcho_search, honcho_conclude),
full 'hermes honcho' CLI, session strategies, AI peer identity, recallMode A/B,
gateway lifecycle management, and comprehensive docs.

Cherry-picks fixes from PRs NousResearch#831/NousResearch#832 (adavyas).

Co-authored-by: erosika <erosika@users.noreply.github.com>
Co-authored-by: adavyas <adavyas@users.noreply.github.com>
olympus-terminal pushed a commit to olympus-terminal/hermes-agent that referenced this pull request May 16, 2026
…session title integration, setup CLI

Authored by erosika. Builds on NousResearch#38 and NousResearch#243.

Adds async write support, configurable memory modes, context prefetch pipeline,
4 new Honcho tools (honcho_context, honcho_profile, honcho_search, honcho_conclude),
full 'hermes honcho' CLI, session strategies, AI peer identity, recallMode A/B,
gateway lifecycle management, and comprehensive docs.

Cherry-picks fixes from PRs NousResearch#831/NousResearch#832 (adavyas).

Co-authored-by: erosika <erosika@users.noreply.github.com>
Co-authored-by: adavyas <adavyas@users.noreply.github.com>
Egavasyug pushed a commit to Egavasyug/hermes-agent that referenced this pull request Jun 10, 2026
…session title integration, setup CLI

Authored by erosika. Builds on NousResearch#38 and NousResearch#243.

Adds async write support, configurable memory modes, context prefetch pipeline,
4 new Honcho tools (honcho_context, honcho_profile, honcho_search, honcho_conclude),
full 'hermes honcho' CLI, session strategies, AI peer identity, recallMode A/B,
gateway lifecycle management, and comprehensive docs.

Cherry-picks fixes from PRs NousResearch#831/NousResearch#832 (adavyas).

Co-authored-by: erosika <erosika@users.noreply.github.com>
Co-authored-by: adavyas <adavyas@users.noreply.github.com>
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