Skip to content

fix(memory): align Honcho routing and memory guidance#17186

Open
nepenth wants to merge 4 commits into
NousResearch:mainfrom
nepenth:fix/honcho-profile-memory-routing-20260428
Open

fix(memory): align Honcho routing and memory guidance#17186
nepenth wants to merge 4 commits into
NousResearch:mainfrom
nepenth:fix/honcho-profile-memory-routing-20260428

Conversation

@nepenth

@nepenth nepenth commented Apr 29, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR fixes Honcho memory/profile routing and built-in memory guidance.

  • Align Honcho peer-card writes with the same observer/target route used by profile reads, so honcho_profile(peer="user", card=[...]) updates the card that honcho_profile(peer="user") returns.
  • Align Honcho prefetch/session context routing with manual profile routing when assistant-observes-user mode is enabled, so auto-injected context and explicit tools see the same peer perspective/target.
  • Clarify honcho_profile card replacement semantics: passing card overwrites the whole peer card, so callers MUST include facts they want preserved.
  • Remove the advertised honcho_context.query parameter for now because the handler did not implement query filtering; this avoids a misleading schema until filtering is added deliberately.
  • Improve built-in memory-full guidance so agents use memory.replace / memory.remove, skills, or canonical workspace artifacts instead of claiming to save exact state “mentally” or relying on semantic memory as the only canonical store.
  • Keep memory limit defaults aligned across config/runtime/migration surfaces and add broader drift coverage.

Tests

  • python -m pytest tests/honcho_plugin/test_session.py tests/tools/test_memory_tool.py tests/tools/test_memory_tool_import_fallback.py -q -o 'addopts=' → 162 passed
  • Targeted regressions added/covered:
    • peer-card write/read observer-target alignment
    • prefetch auto-injected context routing for assistant-observes-user mode
    • session-context peer perspective/target routing
    • honcho_profile handler empty-card overwrite behavior
    • honcho_profile schema warning that card overwrites the entire card
    • honcho_context schema no longer advertising an unimplemented query filter
    • memory-full overflow guidance naming memory.replace, memory.remove, skills, and canonical artifacts
    • memory limit defaults checked across DEFAULT_CONFIG, MemoryStore, and the OpenClaw migration helper
  • python -m py_compile plugins/memory/honcho/__init__.py plugins/memory/honcho/session.py tools/memory_tool.py hermes_cli/config.py run_agent.py hermes_cli/tips.py optional-skills/migration/openclaw-migration/scripts/openclaw_to_hermes.py
  • git diff --check
  • Static added-line scan for obvious secret/shell/eval/pickle/SQL-risk patterns → clean
  • Independent local review pass performed on the patch set before push.

Security / platform notes

  • No credentials, tokens, network endpoints, or provider secrets are added.
  • No shell execution, subprocess behavior, SQL generation, filesystem deletion, or migration side effects are added.
  • The Honcho behavior change is limited to client-side peer routing/schema/guidance; it does not change Honcho server storage semantics.
  • The memory-limit drift test imports the migration helper for constants only; it does not execute a migration.
  • This PR intentionally does NOT implement honcho_context(query=...) filtering; the misleading schema field is removed instead. Query filtering can be a focused follow-up.

Review feedback remediation (2026-04-30)

  • Added regression coverage for honcho_profile(peer="ai", card=[...]) round-tripping through the same observer/target route used by reads.
  • Confirmed existing regression coverage for card=[] clearing peer cards instead of being treated as a read.
  • Confirmed honcho_context no longer advertises the unimplemented query schema parameter.
  • Updated the PR title/scope language to make Honcho routing and memory guidance/default alignment explicit.

Relationship to context-safety work

Related but independent from the gateway context-safety PRs. This PR fixes Honcho memory/profile routing consistency so long-term context is read and written through the correct observer/target path.

Adjacent PRs:

Ensure Honcho peer-card writes use the same observer/target path as reads so profile card updates land on the card that later lookups return.

Increase built-in memory headroom and make overflow guidance route durable facts to the correct persistence layer instead of implying mental retention.
@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have comp/plugins Plugin system and bundled plugins comp/agent Core agent loop, run_agent.py, prompt builder tool/memory Memory tool and memory providers area/config Config system, migrations, profiles labels Apr 29, 2026
@nepenth nepenth marked this pull request as ready for review April 29, 2026 01:21
@nepenth nepenth marked this pull request as draft April 30, 2026 13:28
@nepenth nepenth changed the title fix: align Honcho card writes and memory routing fix(memory): align Honcho routing and built-in memory guidance Apr 30, 2026
@nepenth nepenth changed the title fix(memory): align Honcho routing and built-in memory guidance fix(memory): align Honcho routing and memory guidance Apr 30, 2026
@nepenth nepenth marked this pull request as ready for review April 30, 2026 15:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/config Config system, migrations, profiles comp/agent Core agent loop, run_agent.py, prompt builder comp/plugins Plugin system and bundled plugins P3 Low — cosmetic, nice to have tool/memory Memory tool and memory providers type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants