Skip to content

fix(slack): mrkdwn in edit_message + thread replies without @mentions#5733

Merged
teknium1 merged 2 commits into
mainfrom
hermes/hermes-03d7aa21
Apr 7, 2026
Merged

fix(slack): mrkdwn in edit_message + thread replies without @mentions#5733
teknium1 merged 2 commits into
mainfrom
hermes/hermes-03d7aa21

Conversation

@teknium1

@teknium1 teknium1 commented Apr 7, 2026

Copy link
Copy Markdown
Contributor

Summary

Two Slack gateway improvements salvaged from @jarvisxyz PRs.

1. Apply mrkdwn conversion in edit_message (PR #5568)

  • send() already calls format_message() to convert markdown → Slack mrkdwn
  • edit_message() bypassed it, so edited messages showed broken markdown
  • 4-line fix

2. Thread replies without explicit @mentions (PR #5579)

  • Adds _has_active_session_for_thread() to detect ongoing thread conversations
  • If a thread already has an active session, replies are processed without needing @mention
  • Uses set_session_store() on base adapter, injected by GatewayRunner at startup
  • 6 new test cases

Not included: PR #5582's thread history feature (duplicate context risk with session memory, no rate limit handling). Left open for design iteration.

Test results

  • 69/69 Slack gateway tests pass

Closes #5568, closes #5579

eizus added 2 commits April 6, 2026 21:26
The edit_message method was sending raw content directly to Slack's
chat_update API without converting standard markdown to Slack's mrkdwn
format. This caused broken formatting and malformed URLs (e.g., trailing
** from bold syntax became part of clickable links → 404 errors).

The send() method already calls format_message() to handle this conversion,
but edit_message() was bypassing it. This change ensures edited messages
receive the same markdown → mrkdwn transformation as new messages.

Closes: PR #5558 formatting issue where links had trailing markdown syntax.
When a user replies in a Slack thread where the bot has an active
conversation session, the bot now processes the message even without
an explicit @mention. This improves UX for ongoing threaded
discussions.

Changes:
- Added set_session_store() to BasePlatformAdapter for adapters to
  check active sessions
- Modified SlackAdapter to detect thread replies and check if a
  session exists for that thread before requiring @mentions
- Updated GatewayRunner to inject the session store into adapters
- Added comprehensive tests for the new behavior

Fixes: Thread replies without @jarvis are now processed if there is
an active session, matching user expectations for conversation flow
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants