Repository navigation
Description
Summary
When a user starts a conversation via Slack and then continues that same conversation via the Web UI, the agent's responses are still being posted to the Slack thread. This is a privacy concern because the user may have intentionally moved to the Web UI for privacy.
Current Behavior
- User sends a message via Slack → Agent responds in the same Slack thread
- User sends another message in that Slack thread → Agent responds again in the same thread (correct)
- User goes to Web UI, finds that conversation, sends a message → Agent still responds in Slack thread (incorrect)
Expected Behavior
Once the user switches to a different interface (Web UI), responses should only go to that interface. The Slack callback should detect that the last user message came from a different source and stop posting to Slack.
Technical Analysis
The current implementation in enterprise/server/conversation_callback_processor/slack_callback_processor.py:
SlackCallbackProcessoris registered when a new Slack conversation is created- When agent state changes to
AWAITING_USER_INPUTorFINISHED, the callback is invoked - The callback sends a summary to Slack without checking the source of the last user message
The callback currently tracks last_user_msg_id to prevent duplicate processing, but doesn't track whether the message originated from Slack or the Web UI.
Proposed Solution
Track Slack-originated message IDs in the callback processor:
- Add a
last_slack_message_id: int | Nonefield toSlackCallbackProcessor - When Slack sends a message to the conversation (via
SlackUpdateExistingConversationView.send_message_to_v0_conversationor similar), store the resulting event ID in the processor - In
SlackCallbackProcessor.__call__, check iflast_user_msg[0].idmatches thelast_slack_message_id - Only send to Slack if the IDs match; otherwise, log and skip
Implementation Details
# In SlackCallbackProcessor
class SlackCallbackProcessor(ConversationCallbackProcessor):
slack_user_id: str
channel_id: str
message_ts: str
thread_ts: str | None
team_id: str
last_user_msg_id: int | None = None
last_slack_message_id: int | None = None # NEW: Track Slack-originated message
async def __call__(self, callback, observation):
# ... existing checks ...
# Get the ID of the last user message
current_msg_id = last_user_msg[0].id if last_user_msg else None
# NEW: Check if last message came from Slack
if current_msg_id != self.last_slack_message_id:
logger.info(
f'[Slack] Skipping response - last message (id={current_msg_id}) '
f'did not originate from Slack (expected={self.last_slack_message_id})'
)
return
# ... continue with existing logic ...Required Changes
SlackCallbackProcessor: Add source tracking and checkSlackUpdateExistingConversationView: After sending message, update the callback processor with the new message ID- Consider applying similar changes to other integrations (GitHub, GitLab, Jira, Linear) for consistency
Impact
- User Privacy: Users can trust that moving to Web UI provides privacy from Slack
- Backward Compatible: Existing Slack-only conversations continue to work as expected
- Other Integrations: Similar pattern can be applied to GitHub, GitLab, Jira, Linear integrations
Related Files
enterprise/server/conversation_callback_processor/slack_callback_processor.pyenterprise/integrations/slack/slack_view.pyenterprise/integrations/slack/slack_manager.pyenterprise/storage/conversation_callback.py
Activity
fix(slack): stop Slack responses when user continues conversation via…
enyst commentedon Feb 13, 2026
V1 Fix Implementation
The V1 fix has been implemented in PR #TBD. Here's how the V1 fix works:
Changes to
SlackV1CallbackProcessorAdded
_should_respond_to_slack(conversation_id)method:last_slack_message_contentis stored inslack_view_dataTrueif messages match (from Slack) or if tracking is disabled (backward compatibility)Falseif messages don't match (user sent message via Web UI)Added
_get_last_user_message(conversation_id)method:Noneif not foundModified
__call__method:Changes to
slack_view.pyUpdated
_create_slack_v1_callback_processor:message_contentparameterlast_slack_message_contentinslack_view_dataUpdated
_create_v1_conversation:Updated
send_message_to_v1_conversation:slack_view_data['last_slack_message_content']EventCallbackServiceto find and update the callbackBackward Compatibility
last_slack_message_contentis not set inslack_view_data, the privacy check is skippedTests Added
test_skips_response_when_message_not_from_slack: Verifies callback skips when message came from Web UItest_sends_response_when_message_from_slack: Verifies callback processes when message came from Slacktest_backward_compatibility_when_no_tracking: Verifies old callbacks still worktest_last_slack_message_content_serialization: Verifies data is properly stored/restoredfix(slack): add V1 privacy check for Slack callback responses
enyst commentedon Feb 13, 2026
Updated: The V1 fix has been implemented in PR OpenHands/OpenHands#12866 (OpenHands/OpenHands#12866)
The V0 (legacy) fix was implemented in PR OpenHands/OpenHands#12864 (OpenHands/OpenHands#12864)
Both PRs implement the same privacy fix: tracking the content of messages sent from Slack and only sending responses back to Slack when the last user message originated from Slack.
enyst commentedon Feb 13, 2026
Proposed Alternative Solution: Track Message Origin at the Event Level
After investigating the V1 architecture, I've identified a fundamental challenge with the current content-comparison approach and propose a cleaner solution.
The Core Problem
The current approach (comparing message content) has several issues:
Summary instructions are user messages: When the callback sends a summary request, it's added as a user message. This pollutes the "last user message" check.
Content comparison is fragile: If users send similar messages from different sources, content matching fails.
Inefficient fetching: Currently fetching 50 events just to find one message.
Proposed Solution: Add
trigger_sourceto Message EventsOption A: Extend MessageEvent with a
trigger_sourcefieldThe SDK's
MessageEvent(or the message payload) could include an optionaltrigger_sourcefield:Flow:
trigger_source = 'slack'trigger_source = 'web_ui'trigger_source = 'callback'trigger_source != 'callback', check iftrigger_source == 'slack'Benefits:
Option B: Use Conversation-Level "Active Channel" Tracking
Instead of per-message tracking, track the "active channel" at the conversation level:
Flow:
last_user_interaction_sourceBenefits:
Drawbacks:
Option C: Callback Self-Disabling After Response
The simplest approach - each callback responds once per "user turn":
When Slack sends a NEW message, reset the flag.
Benefits:
Drawbacks:
Recommendation
Option A (trigger_source on messages) is the cleanest long-term solution because:
However, it requires SDK changes. If that's too invasive, Option B is a good alternative that can be implemented entirely in the enterprise codebase.
Questions for Discussion
MessageEventto addtrigger_sourceacceptable?github-actions commentedon Apr 19, 2026
This issue is stale because it has been open for 40 days with no activity. Remove the stale label or leave a comment, otherwise it will be closed in 10 days.
github-actions commentedon Jun 1, 2026
This issue is stale because it has been open for 40 days with no activity. Remove the stale label or leave a comment, otherwise it will be closed in 10 days.
github-actions commentedon Jun 11, 2026
This issue was automatically closed due to 50 days of inactivity. We do this to help keep the issues somewhat manageable and focus on active issues.
github-actions commentedon Jul 22, 2026
This issue is stale because it has been open for 40 days with no activity. Remove the stale label or leave a comment, otherwise it will be closed in 10 days.
all-hands-bot commentedon Sep 4, 2026
[Automatic Post]: This issue has had no activity for 39 days (labels: enhancement). Could someone take a look when they have a chance and help figure out next steps?
Generated by OpenHands automation on behalf of the user.
all-hands-bot commentedon Oct 16, 2026
[Automatic Post]: This issue has had no activity for 41 days (labels: enhancement). Could someone take a look when they have a chance and help figure out next steps?
Generated by OpenHands automation on behalf of the user.