feat(mattermost): add block streaming edit-in-place support#25635
Closed
Luna2026-a11y wants to merge 2 commits intoopenclaw:mainfrom
Closed
feat(mattermost): add block streaming edit-in-place support#25635Luna2026-a11y wants to merge 2 commits intoopenclaw:mainfrom
Luna2026-a11y wants to merge 2 commits intoopenclaw:mainfrom
Conversation
added 2 commits
February 24, 2026 09:58
Add patchMattermostPost() and deleteMattermostPost() to the Mattermost
client, and wire them as 'edit' and 'delete' actions in the channel
plugin's message action adapter.
This enables:
- Editing bot messages via the message tool (action=edit)
- Deleting bot messages via the message tool (action=delete)
- Foundation for block-streaming edit-in-place (progressive message
rendering like Telegram/Discord)
Uses PATCH /api/v4/posts/{post_id}/patch for edits and
DELETE /api/v4/posts/{post_id} for deletions.
Tested against a live Mattermost 10.x instance.
Enable progressive message rendering (block streaming) for Mattermost by editing a single message in-place as the model generates text, instead of sending multiple messages. How it works: - First block: send a new message, track its post id - Subsequent blocks: accumulate text and PATCH the existing message - Final reply: edit the message with the complete text - Fallback: if edit fails, gracefully fall back to sending new messages Changes: - channel.ts: declare blockStreaming: true in capabilities - monitor.ts: implement block streaming logic in the deliver function using patchMattermostPost for edit-in-place - client.ts: patchMattermostPost (from previous commit) This brings Mattermost closer to feature parity with Telegram and Discord, which already support block streaming.
| if ((isBlock || isFinal) && blockStreamingClient && mediaUrls.length === 0 && text) { | ||
| if (isBlock && blockStreamMessageId) { | ||
| // Subsequent block: accumulate and edit the existing message | ||
| blockStreamAccumulatedText += (blockStreamAccumulatedText ? "\n" : "") + text; |
Contributor
There was a problem hiding this comment.
accumulated text with newline separator for multiple blocks
Prompt To Fix With AI
This is a comment left during a code review.
Path: extensions/mattermost/src/mattermost/monitor.ts
Line: 793
Comment:
accumulated text with newline separator for multiple blocks
How can I resolve this? If you propose a fix, please make it concise.
Contributor
Use case: Mattermost as primary channelWe use Mattermost as our primary channel for multiple agents (including a coach, a knowledge-base agent, and a PA). The lack of progressive rendering makes the UX feel sluggish compared to Telegram — users just see a long pause followed by a wall of text. Streaming edit-in-place would be a significant UX improvement for Mattermost deployments and bring it on par with Telegram/Discord. Setup context:
Looking forward to this — happy to test once a branch is available. |
Member
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
Enable progressive message rendering (block streaming) for Mattermost by editing a single message in-place as the model generates text, instead of sending multiple separate messages.
How it works
PATCH /api/v4/posts/{id}/patchthe existing messageThis is the same pattern used by the Telegram and Discord plugins.
User experience
Before: User asks question → 10s silence → wall of text appears
After: User asks question → text starts appearing after ~1-2s and writes progressively
Files changed
extensions/mattermost/src/channel.ts— declareblockStreaming: truein capabilitiesextensions/mattermost/src/mattermost/monitor.ts— implement block streaming logic in deliver functionextensions/mattermost/src/mattermost/client.ts—patchMattermostPost()(from feat(mattermost): add edit and delete message actions #25295)Dependencies
Builds on #25295 (edit/delete message actions) which adds
patchMattermostPost().Testing
patchMattermostPostagainst live Mattermost 10.x instanceblockStreaming,blockStreamingCoalesce)Configuration
Block streaming is enabled by default. Users can disable it per-account:
Greptile Summary
This PR adds block streaming (progressive message rendering) to Mattermost by editing a single message in-place as text generates, matching the pattern used by Telegram and Discord plugins.
Key changes:
blockStreaming: truecapability in channel configurationChannelMessageActionAdapterdeliverfunction with state tracking (blockStreamMessageId,blockStreamAccumulatedText)How it works:
PATCH /api/v4/posts/{id}/patchThe implementation is clean and follows established patterns in the codebase. Block streaming defaults to enabled but can be disabled per-account via config.
Confidence Score: 4/5
Last reviewed commit: 4a062d5
(3/5) Reply to the agent's comments like "Can you suggest a fix for this @greptileai?" or ask follow-up questions!