Bug
After #10991 / commit 4459913f (DingTalk AI Cards), BasePlatformAdapter.edit_message() gained a finalize: bool = False keyword-only parameter, plumbed through stream_consumer.py. The DingTalk adapter was updated, but MattermostAdapter.edit_message() still has the old signature:
async def edit_message(self, chat_id: str, message_id: str, content: str) -> SendResult:
Python raises TypeError: edit_message() got an unexpected keyword argument 'finalize' on every streaming chunk, completely breaking progressive message editing for Mattermost. The error log fills with hundreds of identical lines per response.
Impact
- All streaming edits fail, forcing fallback to new messages
- Error log noise (hundreds of lines per response)
- Potential threading/delivery issues from the fallback path
Fix
One-liner — accept and ignore the kwarg:
async def edit_message(self, chat_id: str, message_id: str, content: str, **kwargs: Any) -> SendResult:
Other adapters that override edit_message should be audited for the same issue.
Affected version
Current main (post-4459913f)
Bug
After #10991 / commit
4459913f(DingTalk AI Cards),BasePlatformAdapter.edit_message()gained afinalize: bool = Falsekeyword-only parameter, plumbed throughstream_consumer.py. The DingTalk adapter was updated, butMattermostAdapter.edit_message()still has the old signature:Python raises
TypeError: edit_message() got an unexpected keyword argument 'finalize'on every streaming chunk, completely breaking progressive message editing for Mattermost. The error log fills with hundreds of identical lines per response.Impact
Fix
One-liner — accept and ignore the kwarg:
Other adapters that override
edit_messageshould be audited for the same issue.Affected version
Current
main(post-4459913f)