MessageEvent wraps source in nested SessionSource — fields at the
top level don't exist, causing resolve_peer() to always fall through
to the fallback_peer. This meant every Discord user got a raw
snowflake peer created instead of the mapped name.
- Add contextvars.ContextVar to carry resolved peer name from
pre_gateway_dispatch to Honcho session init without modifying
event.user_id (auth uses raw Discord snowflake)
- _pre_gateway_dispatch: now stores resolved peer in context var
- _patched_do_session_init: reads context var first, falls back
to kanban resolution, then to existing user_id
Requires thread_sessions_per_user: true in profile config.yaml
(added to ashley, claire, finn, matt, paul)
The plugin now monkey-patches HonchoMemoryProvider._do_session_init at
plugin load time instead of requiring changes to any file in the Hermes
repo. This means:
- No modifications to plugins/memory/honcho/__init__.py or any other file
- No fork needed — pure plugin approach
- Survives Hermes upgrades without merge conflicts
- Removed docs/honcho-injector.md (replaced by docs/how-it-works.md)
- Updated README with new architecture description
Config file at /opt/data/identity-config.json remains the single source
of truth for mappings.