fix(tools): treat Slack channel IDs as explicit send_message targets#2897
Open
seichris wants to merge 1 commit intoNousResearch:mainfrom
Open
fix(tools): treat Slack channel IDs as explicit send_message targets#2897seichris wants to merge 1 commit intoNousResearch:mainfrom
seichris wants to merge 1 commit intoNousResearch:mainfrom
Conversation
178fd3f to
77b04af
Compare
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 Slack
send_messagetarget parsing so explicit channel IDs are treated as explicit destinations instead of falling back to the home DM. It also normalizes Slack channel mention syntax before resolution and adds a regression test for the channel-ID path.Related Issue
No issue filed.
Type of Change
Changes Made
slack:C0AD2A7C4G1as explicit targets.<#CHANNELID|name>) and stripped/ topic Nsuffixes before Slack target parsing.send_messagetarget schema description to document Slack channel IDs and mention-style targets.How to Test
source venv/bin/activate && python -m pytest tests/tools/test_send_message_tool.py -q.send_message_toolwithtarget="slack:C0AD2A7C4G1"and verify_send_to_platform(...)is called with chat IDC0AD2A7C4G1rather than a home DM channel.<#C0AD2A7C4G1|agents-updates>.Checklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/ -qand all tests passNote: I ran
source venv/bin/activate && python -m pytest tests/ -q. On this branch it finished with2 failed, 5950 passed, 175 skipped; the two failures reproduce on cleanmainas well:tests/agent/test_prompt_builder.py::TestBuildContextFilesPrompt::test_claude_md_uppercase_takes_prioritytests/test_real_interrupt_subagent.py::TestRealSubagentInterrupt::test_interrupt_child_during_api_callDocumentation & 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/AScreenshots / Logs
source venv/bin/activate && python -m pytest tests/tools/test_send_message_tool.py -q->20 passed, 3 warnings in 4.26ssend_message_tool({'action': 'send', 'target': 'slack:C0AD2A7C4G1', 'message': 'hello'})passed and called_send_to_platform(..., 'C0AD2A7C4G1', ...).