fix(discord): recall prior thread context after bot replies - #52650
fix(discord): recall prior thread context after bot replies#52650reefmind wants to merge 1 commit into
Conversation
Related: #42075 (skip bot messages in thread backfill) and #51414 ( |
teknium1
left a comment
There was a problem hiding this comment.
Thanks for isolating the thread-history gap and adding a focused cold-start regression test.
Problems
- The new continuation branch does not work after a normal Hermes response. The unchanged
after=_after_objcall atplugins/platforms/discord/adapter.py:4414filters out messages at or before the cached self-message ID before the newif recall_thread_historybranch at:4433can see them. Current main stores that cache after normal sends atplugins/platforms/discord/adapter.py:2085-2092. - The new regression test at
tests/gateway/test_discord_free_response.py:682does not seed_last_self_message_id, so it covers only the cache-miss path.
Suggested changes
- Disable or adjust the cached
afterboundary when recall is enabled, and add a cache-seeded regression case. - Coordinate the default/configuration choice with the related approaches cited in the existing triage note (#42075 and #51414).
Automated hermes-sweeper review.
| # session transcript. (Redundant when _after_obj is set, but | ||
| # needed for cold start.) | ||
| if msg.author == self._client.user: | ||
| if recall_thread_history: |
There was a problem hiding this comment.
This branch is unreachable for the normal hot path: the unchanged channel.history(..., after=_after_obj) above already excludes every message at or before _last_self_message_id, and normal sends populate that cache. Disable/adjust that after boundary when recall is enabled, then add a regression test that seeds _last_self_message_id.
Summary
Tests
python -m pytest tests/gateway/test_discord_free_response.py -qpython -m ruff check plugins/platforms/discord/adapter.py tests/gateway/test_discord_free_response.pypython -m py_compile plugins/platforms/discord/adapter.py tests/gateway/test_discord_free_response.py