fix: preserve Discord lane metadata in LCM - #292
stephenschoettler merged 1 commit into
Conversation
973af51 to
97add7b
Compare
|
Thanks for the PR. Could you update the description to match the repo template before I review? Please add:
The code can stay as-is. This just makes review, release notes, and future archaeology easier. |
|
Updated the PR body to match the repo template and replaced the ad-hoc Tests section with a full Validation section. I also added the companion Hermes Agent PR link in Notes, since this LCM change consumes the generic host metadata from that PR when available. |
stephenschoettler
left a comment
There was a problem hiding this comment.
Focused maintainer pass on 97add7b.
Verdict: approved.
What I checked:
- PR metadata, body, changed files, CI, comments, and review threads.
- Clean simulated merge onto current
origin/main(428f83c), no conflicts. - Post-turn ingest now prefers the active LCM context-engine clone when supplied and falls back to the plugin singleton for older hosts.
conversation_idis migrated/stored/indexed on raw message rows and threaded through Discord-lane ingest,MessageStore.search,lcm_grep, andlcm_expand(store_id=...)output.lcm_grep(conversation_id=...)stays raw-message-only rather than mixing unscoped summary hits.- Companion Hermes Agent PR metadata shape matches the expected hook keys, with private lane attrs preferred and public fallback kept.
Validation I ran on a clean merge-check worktree:
- focused PR tests: 6 passed
python -m pytest tests/test_lcm_core.py tests/test_lcm_engine.py tests/test_packaging_install.py -q -o addopts=: 689 passedpython -m pytest tests -q -o addopts=: 1053 passedpython -m compileall -q .: passedgit diff --check --cached: passed
No blockers found on the LCM side. The companion Agent PR is still separately responsible for delivering the new host metadata in production; this plugin PR remains backward-compatible without it.
|
Thanks, this is approved, checks are green, and the current policy gates pass. I am merging this now. |
Summary
conversation_idon raw LCM messages so Discord channel/thread/forum-topic lanes can be attributed and filtered.conversation_idfilter to raw-message search andlcm_grep, alongside the existingsource,session_id, role, and time filters.Why
Hermes Agent already routes Discord conversations with lane-specific gateway session keys, but LCM raw message rows only carried coarse
source=discordmetadata. That makes multi-channel retrieval and debugging too broad: different Discord channels, threads, and forum topics become hard to distinguish after ingest.This keeps the existing
sourcebehavior intact and addsconversation_idas a narrower optional attribution/filter. Existing rows remain valid withconversation_id=''.Newer Hermes Agent hosts clone context engines per agent/session. For short turns that never trigger compression, the post-turn ingest hook should follow the active LCM clone when available instead of assuming the plugin singleton is the live session engine.
Validation
python -m pytest tests/test_packaging_install.py::test_post_llm_hook_prefers_active_lcm_clone tests/test_packaging_install.py::test_post_llm_hook_rebinds_legacy_singleton_between_gateway_lanes tests/test_lcm_engine.py::test_discord_short_turn_ingest_preserves_conversation_id tests/test_lcm_engine.py::TestEngineABC::test_lcm_grep_filters_live_discord_history_by_conversation_id tests/test_lcm_core.py::TestMessageStore::test_conversation_id_stored_and_filterable_for_discord_lanes tests/test_lcm_core.py::TestMessageStore::test_like_fallback_filters_by_conversation_id -q -o addopts=-> 6 passed.python -m pytest tests/test_lcm_core.py tests/test_lcm_engine.py tests/test_packaging_install.py -q -o addopts=-> 688 passed, 3 dependency deprecation warnings.python -m pytest tests -q -o addopts=-> 1053 passed, 3 dependency deprecation warnings.bash -lc 'ulimit -n 1024 && pytest -q'-> 1053 passed, 3 dependency deprecation warnings.python -m compileall -q .python -m py_compile scripts/import_lossless_claw.pybash -n scripts/install.sh scripts/update.shgit diff --check97add7b:workflow-linttest (3.11)test (3.12)test (3.13)test (3.14)conversation_id lcm_grep discord lane metadata; no matching existing PR/issue found.Notes
post_llm_callhooks. This LCM PR consumes that metadata when available and remains backward-compatible when the host does not pass it.conversation_id='', source filters keep their old behavior, and the legacy singleton path explicitly rebinds between lanes such as Discord topics and Telegram DMs.