fix(tools): recognize email addresses as explicit targets in send_message#34748
Closed
liuhao1024 wants to merge 1 commit into
Closed
fix(tools): recognize email addresses as explicit targets in send_message#34748liuhao1024 wants to merge 1 commit into
liuhao1024 wants to merge 1 commit into
Conversation
…sage When using send_message with the email platform, valid email addresses like user@example.com were not recognized as explicit targets by _parse_target_ref(). This caused the function to return (None, None, False), forcing the system into channel-name resolution which has no way to resolve a raw email address, resulting in 'No home channel set for email' errors. Add _EMAIL_TARGET_RE pattern and email platform handler in _parse_target_ref() so email addresses are treated as explicit targets and routed directly without requiring a home target configuration.
This was referenced May 30, 2026
Contributor
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.
What does this PR do?
Fixes
send_messageemail platform routing: valid email addresses likeuser@example.comare now recognized as explicit targets by_parse_target_ref(), preventing the "No home channel set for email" error when sending proactive emails.Related Issue
Fixes #34740
Type of Change
Changes Made
tools/send_message_tool.py: Added_EMAIL_TARGET_REregex pattern and email platform handler in_parse_target_ref()so email addresses are recognized as explicit targets and routed directlytests/tools/test_send_message_tool.py: AddedTestParseTargetRefEmailclass with 6 regression tests covering valid emails, edge cases (plus-tags, dots, whitespace), invalid addresses, and cross-platform isolationHow to Test
pytest tests/tools/test_send_message_tool.py -k "TestParseTargetRefEmail" -v— all 6 tests should passpytest tests/tools/test_send_message_tool.py -k "TestParseTargetRef" -v— all 30 existing + new tests should pass (no regressions)_parse_target_ref("email", "user@example.com")returns("user@example.com", None, True)instead of(None, None, False)Checklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/ -qand all tests passDocumentation & Housekeeping
docs/, docstrings) — or N/Acli-config.yaml.exampleif I added/changed config keys — or N/ACONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows — or N/ACode Intelligence
tools/send_message_tool.py:_parse_target_ref(callers: 3 in send_message_tool.py)