send_message: verify thread matches target profile, fall back to compose#18
Merged
Conversation
Documents the thread-match verification added for send_message (header + profile-URL checks) to prevent messaging the wrong recipient. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Documents the compose-fallback fix for send_message when a connection has no existing thread yet. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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
send_messagenow falls back to the "Compose a new message" typeahead when a connection has no existing thread anywhere (e.g. accepted without a note) — matches the recipient by name and adds them.../messaging/thread/new/) have no persisted thread id, so their title bar just reads "New message" — verification now checks the conversation's profile card first, which carries the recipient's name and an already-resolved vanity-slug link (no click-and-navigate needed there)testing/tools/send_message.py, a manual live tool for sending a real DM through this flowTest plan
testing/tests/test_send_message_thread_match.pycovers header-match, profile-URL-match, and compose-fallback cases (including a same-name-wrong-person scenario caught by the resolved URL)testing/tools/check_thread_match.py/testing/tools/send_message.pymanual check tools🤖 Generated with Claude Code