Skip to content

fix: support Slack thread targets in send_message - #24241

Closed
mzkarami wants to merge 1 commit into
NousResearch:mainfrom
mzkarami:fix/slack-send-message-thread-ts
Closed

fix: support Slack thread targets in send_message#24241
mzkarami wants to merge 1 commit into
NousResearch:mainfrom
mzkarami:fix/slack-send-message-thread-ts

Conversation

@mzkarami

Copy link
Copy Markdown
Contributor

Summary

  • Add support for Slack chat_id:thread_ts targets in send_message
  • Preserve the parsed Slack thread timestamp through target parsing and dispatch
  • Pass thread_ts to Slack chat.postMessage so explicit sends land in the requested thread
  • Add unit coverage for parsing and dispatching Slack thread targets

Problem

send_message documents platform:chat_id:thread_id style targets for threaded delivery, but Slack channel/DM IDs were previously parsed only as bare C..., G..., or D... IDs. A target like:

slack:C0123456789:1778566499.343239

could not preserve the Slack thread timestamp through _parse_target_ref, so _send_to_platform had no thread_id to pass to Slack. That makes explicit Slack thread delivery unreliable and can cause messages intended for a thread to be sent as normal channel messages instead.

Solution

  • Extend _SLACK_TARGET_RE to accept an optional Slack thread_ts suffix
  • Return the parsed thread timestamp from _parse_target_ref for Slack targets
  • Thread the value through _send_to_platform into _send_slack
  • Include thread_ts in the Slack Web API payload when present
  • Return thread_id in the success result for observability

Tests

  • git diff --check
  • /home/dev/.hermes/hermes-agent/venv/bin/python -m pytest tests/tools/test_send_message_tool.py -q

Result:

113 passed, 39 warnings

Warnings are dependency deprecation warnings from existing third-party packages.

Parse optional Slack thread_ts suffixes in send_message targets and forward them to chat.postMessage as thread_ts so explicit Slack thread deliveries stay in the requested thread.

Add unit coverage for Slack thread target parsing and dispatch.
@alt-glitch alt-glitch added type/bug Something isn't working comp/tools Tool registry, model_tools, toolsets platform/slack Slack app adapter duplicate This issue or pull request already exists P2 Medium — degraded but workaround exists labels May 12, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Duplicate of #16992 (open since 2026-04-28, same fix). Also duplicates #23764, #21486, #18911, #17741 — all addressing the same _parse_target_ref + _send_slack thread_ts gap.

@mzkarami

mzkarami commented Jun 3, 2026

Copy link
Copy Markdown
Contributor Author

Duplicate of #16992 (open since 2026-04-28, same fix)

@mzkarami mzkarami closed this Jun 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/tools Tool registry, model_tools, toolsets duplicate This issue or pull request already exists P2 Medium — degraded but workaround exists platform/slack Slack app adapter type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants