Skip to content

fix(slack): preserve thread context for Agents & Assistants DM root messages#2228

Open
BingqingLyu wants to merge 3 commits into
mainfrom
fork-pr-63840-islo-build-openclaw-63659-claude-1775744458
Open

fix(slack): preserve thread context for Agents & Assistants DM root messages#2228
BingqingLyu wants to merge 3 commits into
mainfrom
fork-pr-63840-islo-build-openclaw-63659-claude-1775744458

Conversation

@BingqingLyu

@BingqingLyu BingqingLyu commented Apr 28, 2026

Copy link
Copy Markdown
Owner

Summary

Preserves thread context for Agents & Assistants DM root messages in Slack integration.

Closes openclaw#63659

Testing

  • Relevant tests pass

This PR was developed with AI assistance (Claude). All code has been reviewed and tested.
Built with islo.dev

islo and others added 3 commits April 12, 2026 10:48
Add missing "context_window_exceeded" (underscore variant) pattern to
the mockedIsLikelyContextOverflowError stub in the test harness. The
real isLikelyContextOverflowError delegates to isContextOverflowError
which matches "context_window_exceeded", but the mock only checked
"context window exceeded" (spaces). This caused the new stopReason-based
context overflow test to always fail because the mock returned false for
"model_context_window_exceeded".

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The previous fix unconditionally set messageThreadId when hasThreadTs was
true, which affected channel/group messages where thread_ts == ts (auto-
created top-level threads). This caused buildSlackThreadingToolContext to
force replyToMode to "all" in non-DM contexts, unexpectedly routing tool
and subagent outputs into threads.

Now the override only applies when channel_type is "im", correctly
limiting it to the Slack Agents & Assistants DM root-message scenario.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

[Slack] Subagent results lose thread_ts in DM assistant threads — cross-thread contamination with concurrent requests

2 participants