Skip to content

fix(honcho): restore profile fallback and backfill memory files - #13359

Closed
stephenschoettler wants to merge 1 commit into
NousResearch:mainfrom
stephenschoettler:fix/honcho-profile-fallback-backfill
Closed

fix(honcho): restore profile fallback and backfill memory files#13359
stephenschoettler wants to merge 1 commit into
NousResearch:mainfrom
stephenschoettler:fix/honcho-profile-fallback-backfill

Conversation

@stephenschoettler

@stephenschoettler stephenschoettler commented Apr 21, 2026

Copy link
Copy Markdown
Contributor

Bug Description

honcho_profile could return an empty profile even when Honcho session context already had a populated peer card. Existing sessions also never imported USER.md, MEMORY.md, or SOUL.md if they were created before the migration path ran.

Root Cause

  • get_peer_card() only trusted the direct peer-card lookup path.
  • Existing-session migration only ran for brand new Honcho sessions.

Fix

  • fall back to session context peer-card data when direct peer-card lookup is empty
  • make honcho_profile fall back to session context before returning an empty result
  • backfill memory files into existing non-per-session Honcho sessions once per content hash and persist a local backfill marker
  • add regression coverage for both fallback and backfill paths

How to Verify

  1. Run source venv/bin/activate && pytest tests/honcho_plugin/test_session.py -q.
  2. Confirm honcho_profile returns session-context facts when direct peer-card lookup is empty.
  3. Confirm an existing session backfills memory files only once for a given memory-file hash.

Test Plan

  • Added regression test for this bug
  • Existing tests still pass
  • Manual verification of the fix

Manual verification:

  • source venv/bin/activate && pytest tests/honcho_plugin/test_session.py -q
  • source venv/bin/activate && python - <<'PY' from plugins.memory.honcho.client import HonchoClientConfig, get_honcho_client from plugins.memory.honcho.session import HonchoSessionManager cfg = HonchoClientConfig.from_global_config() client = get_honcho_client(cfg) mgr = HonchoSessionManager(honcho=client, config=cfg) s = mgr.get_or_create(cfg.resolve_session_name(cwd='/home/w0lf')) print(mgr.get_peer_card(s.key, peer='user')[:8]) PY

Risk Assessment

Low - the fallback only activates when the direct card lookup is empty, and the backfill path is limited to non-per-session sessions with local memory files and a new content hash.

- fall back to session context when direct peer-card lookup is empty
- backfill USER.md, MEMORY.md, and SOUL.md into existing sessions once per content hash
- add regression tests for both paths
@stephenschoettler

Copy link
Copy Markdown
Contributor Author

Superseded by #13369. The two failing checks here were caused by this branch being based on a stale main snapshot, which pulled in unrelated failures and triggered the supply-chain scan on old setup.py changes. I rebuilt the Honcho patch cleanly on current main and opened a fresh PR with only the 3 intended files changed.

@stephenschoettler

Copy link
Copy Markdown
Contributor Author

Superseded again by #13375. #13369 removed the unrelated test failures but was still based on a stale main snapshot, so the supply-chain audit kept seeing unrelated setup.py changes. #13375 is rebased onto current main and contains only the 3 intended Honcho files.

@stephenschoettler

Copy link
Copy Markdown
Contributor Author

Closing as superseded by #13375.

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.

1 participant