feat(chat): add message update and delete lifecycle callbacks - #788
Merged
Conversation
…` events in Slack adapter.
…andling in Slack adapter
…e chat prepare rebuildable Upstream #674/#675 introduced the shared @chat-adapter/tests factories and matchers, which the rebased adapter-slack tests now use. The mock ChatInstance did not stub the fork's processMessageUpdated/processMessageDeleted lifecycle processors, so the message_changed/message_deleted suites failed with 'this.chat.processMessageUpdated is not a function'. Add both processors to createMockChatInstance and to the toHaveDispatched handler list. Also make the chat package's prepare script remove dist before tsup: with a previous build's dist/jsx-runtime.d.ts present, the dts step resolves the chat/jsx-runtime export to the built file and fails with TS5055 (cannot overwrite input file). Upstream never hits this because its build script always cleans first; prepare (used for git installs) did not.
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
3 tasks
bensabic
approved these changes
Aug 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
summary
adds
onMessageUpdatedandonMessageDeleted, so a bot can react when a message is edited or removed. Slack dispatches both today; other adapters can opt in latersupersedes #549, which was verified there against real Slack webhooks. reopened from a branch in this repo with the original commits preserved and signed
both are lifecycle events: they never route through
onNewMessage,onNewMention, oronSubscribedMessage, and the concurrency strategies do not applynotes
message_changedfor everychat.update, and post-and-edit streaming calls it once per delta, so without this a single streamed reply would call the handler back repeatedly on its own messagepreviousMessageis forwarded on edits. slack sends the pre-edit message and it was being dropped. an edit handler usually needs the before to know what changed, so it is the optional third argument(thread, message, previousMessage?). a delete has no message, only the id of what was removed, so it gets an event. usechat.thread(event.threadId)when a delete handler needs onetest plan
core:
onMessageUpdatedand not to the normal message handlersslack:
message_changeddispatches as an update,message_deletedas a deleteprevious_messageis forwarded, and left undefined when slack omits itagent_viewDMverified against a real slack workspace over socket mode: editing and deleting a DM both routed to the same thread id as the original message