test(gateway): align telegram DM topic metadata expectations with new direct_messages_topic_id key#27462
Closed
briandevans wants to merge 2 commits into
Closed
Conversation
… direct_messages_topic_id key Commit 5338250 ("fix(gateway): add direct_messages_topic_id for synthetic Telegram DM events") extended _thread_metadata_for_source in gateway/run.py to emit a new "direct_messages_topic_id" entry whenever a Telegram DM topic lane has a non-General thread_id, but two test expectations weren't updated in lockstep: - tests/gateway/test_telegram_thread_fallback.py:: test_gateway_runner_busy_ack_replies_to_triggering_message_for_telegram_dm_topic - tests/gateway/test_voice_command.py:: TestSendVoiceReply::test_auto_voice_reply_uses_thread_metadata_helper Both exercise the busy-ack / auto-voice-reply paths against a synthetic Telegram DM source with thread_id="20197", which now flows through the new branch and triggers the extra key. They have been failing on every CI run on origin/main since 5338250 landed. Update each `==` metadata-dict assertion to include the new `"direct_messages_topic_id": "20197"` entry alongside the existing keys. No production behavior changes — only the test snapshots are aligned with the new contract. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…xpectation The first commit on this branch updated test_telegram_thread_fallback.py and test_voice_command.py to include `direct_messages_topic_id` in the expected metadata dict (after gateway commit 5338250 started emitting this key for synthetic Telegram DM events). A third test — test_background_command.py::test_telegram_dm_topic_completion_preserves_reply_anchor_metadata — exercises the same DM-topic completion path through `_run_background_task` and was missed in the first sweep, so it kept failing on CI with: Left contains 1 more item: {'direct_messages_topic_id': '20197'} Same one-line expected-dict fix as the other two files; brings the third test file into line with current production behavior. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
|
Closing as already addressed — the test alignments your PR proposed are already passing on current main. The just-merged #28488 (salvage of #27937 Thanks for catching the inconsistency. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two tests have been failing on every CI run on
origin/mainsince5338250da(fix(gateway): add direct_messages_topic_id for synthetic Telegram DM events) landed yesterday. The production change extendedgateway/run.py::_thread_metadata_for_sourceto emit a newdirect_messages_topic_identry for non-General Telegram DM topic lanes, but two test expectations weren't updated alongside it. This PR aligns those snapshots — no production code is touched.The bug
5338250daadded six lines togateway/run.py::_thread_metadata_for_source:For any Telegram DM
MessageEventwiththread_id="20197", the helper now also emits"direct_messages_topic_id": "20197". Two tests use exactly that fixture and assert the metadata dict with a strict==:tests/gateway/test_telegram_thread_fallback.py::test_gateway_runner_busy_ack_replies_to_triggering_message_for_telegram_dm_topictests/gateway/test_voice_command.py::TestSendVoiceReply::test_auto_voice_reply_uses_thread_metadata_helperBoth fail on every CI run with:
These are baseline failures on clean
origin/main(f36c89cd5) and show up red on every open PR.The fix
Add
"direct_messages_topic_id": "20197"to the expected metadata dict in each of the two failing assertions. Nothing else changes.The other 12 occurrences of
telegram_dm_topic_reply_fallbackintest_telegram_thread_fallback.pytest the Telegram adapter directly (without going through_thread_metadata_for_source) and continue to pass — only the two GatewayRunner-helper sites that call the production helper needed updating. Confirmed by running the full files:194 passed, 21 skippedafter the change vs192 passed, 2 failed, 21 skippedbefore.Test plan
origin/main(f36c89cd5):194 passed, 21 skipped in 14.07s(was192 passed, 2 failed, 21 skipped)."direct_messages_topic_id": "20197"lines reproduces the original failure under the same harness; restoring them flips both tests back to PASSED.gateway/run.pyis untouched, so no risk of behavioral drift.Related
5338250da(fix(gateway): add direct_messages_topic_id for synthetic Telegram DM events) by @Timur00Kh