Skip to content

fix(slack): keep thread session fork/history context after first turn#23843

Merged
vincentkoc merged 3 commits intomainfrom
vincentkoc-code/slack-thread-session-continuity
Feb 22, 2026
Merged

fix(slack): keep thread session fork/history context after first turn#23843
vincentkoc merged 3 commits intomainfrom
vincentkoc-code/slack-thread-session-continuity

Conversation

@vincentkoc
Copy link
Member

@vincentkoc vincentkoc commented Feb 22, 2026

Summary

Ports the merge-safe continuity fixes from #23090 onto current main:

  • fork thread/topic sessions from parent even when a preseeded thread session key already exists
  • persist a forkedFromParent flag so parent transcript forking only happens once
  • always fetch configured thread history window in Slack thread sessions (not only first turn)
  • always inject available thread history/starter context into reply prompt composition
  • add regression tests for all three gates
  • add Unreleased changelog entry

Why

Thread session continuity was gated behind first-turn checks in multiple paths, which caused thread context to disappear after the first interaction and prevented expected parent transcript branching in preseeded thread sessions.

Validation

  • pnpm test -- src/auto-reply/reply/session.test.ts src/slack/monitor/message-handler/prepare.test.ts src/auto-reply/reply/get-reply-run.media-only.test.ts
  • pnpm exec oxfmt --check src/slack/monitor/message-handler/prepare.ts src/auto-reply/reply/get-reply-run.ts src/auto-reply/reply/session.ts src/config/sessions/types.ts src/slack/monitor/message-handler/prepare.test.ts src/auto-reply/reply/get-reply-run.media-only.test.ts src/auto-reply/reply/session.test.ts CHANGELOG.md
  • pnpm exec oxlint src/slack/monitor/message-handler/prepare.ts src/auto-reply/reply/get-reply-run.ts src/auto-reply/reply/session.ts src/config/sessions/types.ts src/slack/monitor/message-handler/prepare.test.ts src/auto-reply/reply/get-reply-run.media-only.test.ts src/auto-reply/reply/session.test.ts

Supersedes: #23090

Greptile Summary

Ports thread session continuity fixes from #23090. Removes first-turn-only gates that prevented thread context from persisting beyond the initial interaction.

Key changes:

  • Fork thread sessions from parent even when preseeded thread session key exists (session.ts:340-362)
  • Add forkedFromParent flag to prevent repeated forking (types.ts:39, session.ts:339)
  • Always fetch thread history, not just on first turn (prepare.ts:524)
  • Always inject thread history/starter context into prompts (get-reply-run.ts:263-267)

Test coverage:

  • Regression test for preseeded thread session forking (session.test.ts)
  • Regression test for continued thread history loading (prepare.test.ts)
  • Regression test for thread context in follow-up turns (get-reply-run.media-only.test.ts)

Confidence Score: 5/5

  • Safe to merge - well-tested fix for thread session continuity bug
  • Changes are focused, well-tested with comprehensive regression tests covering all three gates, and fix a clear bug where thread context was lost after first turn. Logic is sound: forkedFromParent flag prevents duplicate forking, and removing first-turn gates enables consistent context.
  • No files require special attention

Last reviewed commit: 35a05d1

@vincentkoc vincentkoc force-pushed the vincentkoc-code/slack-thread-session-continuity branch from 0b32188 to 35a05d1 Compare February 22, 2026 19:29
@vincentkoc vincentkoc marked this pull request as ready for review February 22, 2026 19:29
@vincentkoc vincentkoc merged commit 5e73f33 into main Feb 22, 2026
9 checks passed
@vincentkoc vincentkoc deleted the vincentkoc-code/slack-thread-session-continuity branch February 22, 2026 19:39
MisterGuy420 pushed a commit to MisterGuy420/openclaw-dev that referenced this pull request Feb 22, 2026
…openclaw#23843)

* Slack thread sessions: keep forking and history context after first turn

* Update CHANGELOG.md
carlosrivera pushed a commit to myascendai/meshiclaw that referenced this pull request Feb 23, 2026
…openclaw#23843)

* Slack thread sessions: keep forking and history context after first turn

* Update CHANGELOG.md
gabrielkoo pushed a commit to gabrielkoo/openclaw that referenced this pull request Feb 23, 2026
…openclaw#23843)

* Slack thread sessions: keep forking and history context after first turn

* Update CHANGELOG.md
mreedr pushed a commit to mreedr/openclaw-custom that referenced this pull request Feb 24, 2026
…openclaw#23843)

* Slack thread sessions: keep forking and history context after first turn

* Update CHANGELOG.md
brianleach pushed a commit to brianleach/openclaw that referenced this pull request Feb 26, 2026
…openclaw#23843)

* Slack thread sessions: keep forking and history context after first turn

* Update CHANGELOG.md
mylukin pushed a commit to mylukin/openclaw that referenced this pull request Feb 26, 2026
…openclaw#23843)

* Slack thread sessions: keep forking and history context after first turn

* Update CHANGELOG.md
mylukin pushed a commit to mylukin/openclaw that referenced this pull request Feb 26, 2026
…openclaw#23843)

* Slack thread sessions: keep forking and history context after first turn

* Update CHANGELOG.md
zooqueen pushed a commit to hanzoai/bot that referenced this pull request Mar 6, 2026
…openclaw#23843)

* Slack thread sessions: keep forking and history context after first turn

* Update CHANGELOG.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: slack Channel integration: slack maintainer Maintainer-authored PR size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant