Fix Slack native stream rollover#672
Draft
tdietert wants to merge 1 commit into
Draft
Conversation
Contributor
|
@tdietert is attempting to deploy a commit to the Vercel Team on Vercel. A member of the Team first needs to authorize it. |
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
b18c2ad to
e1ebd3d
Compare
e1ebd3d to
9d97505
Compare
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.
Fixes #671
What problems was I solving
Slack native streamed messages can stop accepting
chat.appendStream/chat.stopStreamcalls while a long-running agent turn is still producing output. Slack reports that state asmessage_not_in_streaming_state; previously the adapter rejected and dropped later output.This PR makes the Slack adapter treat that documented error as the recovery boundary: when the current native streamed message is no longer streamable, the adapter continues the turn in a fresh streamed message in the same thread and retries only the pending chunk.
What user-facing changes did I ship
message_not_in_streaming_stateby starting a fresh stream and retrying only the pending markdown delta.chat.startStream,chat.appendStream, andchat.stopStreamdirectly instead of going throughChatStreamer, so it owns stream lifecycle and confirmed-offset bookkeeping explicitly.^7.17.0for the native stream chunk API surface used by the adapter.How I implemented it
ChatStreamer/buffer_size: 1path and the open-code-fence-prefix workaround from the PR.tstschat.updateon the latest stream segment rather than duplicating the full cumulative answer.chatStream().@chat-adapter/slack.How to verify it
Manual testing
message_not_in_streaming_state, and confirm later deltas continue in a fresh streamed message.Automated tests
pnpm --filter @chat-adapter/slack... build pnpm --filter @chat-adapter/slack... typecheck pnpm --filter @chat-adapter/slack test pnpm check pnpm validateAll of the above passed locally after the refactor.
Changelog
@chat-adapter/slacknow recovers expired Slack native streams by reactively rolling long-running replies onto fresh streamed messages without dropping pending text.