Skip to content

Add proactive threading support#523

Merged
corinagum merged 7 commits into
mainfrom
cg/threaded-replies
Apr 17, 2026
Merged

Add proactive threading support#523
corinagum merged 7 commits into
mainfrom
cg/threaded-replies

Conversation

@corinagum

@corinagum corinagum commented Apr 14, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Add app.reply(conversationId, messageId, activity) for proactive thread sends — constructs threaded conversation ID via toThreadedConversationId() for channels and 1:1 chats that support threading
  • Add toThreadedConversationId() helper exposed for advanced scenarios
  • Add supportsThreading() internal guard (channels: @thread.tacv2/@thread.skype, 1:1: @unq.gbl.spaces)
  • Update context.send() and context.reply() doc comments to clarify threading vs quoting behavior
  • Add threading example bot with commands: test reply, test send, test proactive, test manual

Test plan

  • Unit tests for toThreadedConversationId() (9 tests), supportsThreading() (5 tests), and app.reply() (6 tests)
  • E2E: All commands tested in 1:1 and channel (top-level + existing thread)
  • All tests passed, lint clean

🤖 Generated with Claude Code

Copilot AI review requested due to automatic review settings April 14, 2026 20:41

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds proactive threading support to the Apps SDK by introducing a stable way to construct threaded conversation IDs and a new proactive app.reply() API that can target channel threads.

Changes:

  • Added toThreadId() + supportsThreading() utilities for threaded conversation ID handling.
  • Added overloaded App.reply() for proactive thread sends (threaded in supported scopes, flat otherwise).
  • Added a new examples/threading sample and clarified context.send() / context.reply() doc comments.

Reviewed changes

Copilot reviewed 11 out of 12 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
packages/apps/src/utils/thread.ts Introduces thread ID construction + threading support detection.
packages/apps/src/utils/thread.spec.ts Adds unit tests for toThreadId().
packages/apps/src/utils/index.ts Re-exports toThreadId() from utils barrel.
packages/apps/src/index.ts Exposes toThreadId() on the package public API.
packages/apps/src/contexts/activity.ts Updates doc comments to clarify send vs reply behavior.
packages/apps/src/app.ts Adds proactive reply() overloads and threading guard usage.
packages/apps/src/app.spec.ts Adds tests for new App.reply() behavior.
examples/threading/* Adds a runnable example demonstrating threading usage.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/apps/src/app.ts
Comment thread packages/apps/src/app.spec.ts Outdated
Comment thread packages/apps/src/app.spec.ts
Comment thread examples/threading/README.md
Comment thread examples/threading/package.json
@corinagum
corinagum force-pushed the cg/threaded-replies branch from fdfe803 to 69cb411 Compare April 14, 2026 23:29
Comment thread packages/apps/src/utils/thread.ts
Comment thread packages/apps/src/utils/thread.ts
Comment thread packages/apps/src/utils/thread.ts Outdated
Comment thread packages/apps/src/utils/thread.ts
heyitsaamir
heyitsaamir previously approved these changes Apr 17, 2026
Comment thread packages/apps/src/app.ts

@heyitsaamir heyitsaamir left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Threads is coming to DMs too, so supportsThreads will likely evolve soon!

Comment thread examples/threading/src/index.ts
@corinagum
corinagum merged commit bcc346f into main Apr 17, 2026
9 checks passed
@corinagum
corinagum deleted the cg/threaded-replies branch April 17, 2026 19:26
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.

3 participants