Skip to content

fix(embed): preserve replies after empty assistant messages - #2482

Open
mameikagou wants to merge 1 commit into
langbot-app:masterfrom
mameikagou:fix/embed-empty-assistant-dedupe
Open

fix(embed): preserve replies after empty assistant messages#2482
mameikagou wants to merge 1 commit into
langbot-app:masterfrom
mameikagou:fix/embed-empty-assistant-dedupe

Conversation

@mameikagou

Copy link
Copy Markdown

Overview

Fixes #2480.

Ignore empty previous assistant content when applying substring deduplication. This keeps the real reply that follows an empty assistant frame while preserving deduplication for identical and contained replies.

Adds regression coverage through the real embed widget WebSocket message path.

Screenshots

Not applicable. The behavior is covered by executable widget regression tests.

Checklist

  • I have read the contribution guide.
  • I will sign the CLA when prompted by the bot.
  • I have communicated with the project maintainer.
  • I have tested the changes and ensured they work as expected.

Tests

  • pnpm test:unit (58 passed)
  • pnpm lint (0 errors; existing warnings only)
  • pnpm exec tsc --noEmit
  • pnpm build
  • pnpm exec prettier --check ../src/langbot/templates/embed/widget.js tests/unit/widget-message-dedupe.test.mjs

@dosubot dosubot Bot added size:XS This PR changes 0-9 lines, ignoring generated files. javascript Pull requests that update Javascript code labels Aug 30, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Thank you for your contribution! ❤️ Before we can merge this pull request, we need you to sign the LangBot Contributor License Agreement (CLA). You keep full copyright of your code — the CLA grants us a license to use and distribute your contribution. Signing takes 10 seconds and covers all repositories in this organization, permanently.

感谢您的贡献!合并前请阅读并签署贡献者许可协议(CLA)。您保留代码的全部版权,签署仅需回复下方指定内容,一次签署对本组织全部仓库永久有效。


I have read the CLA Document and I hereby sign the CLA


You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

@RockChinQ

Copy link
Copy Markdown
Member

Hi @mameikagou , 请签署 CLA,否则我们将无法合入此 PR。

@codecov

codecov Bot commented Aug 31, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

javascript Pull requests that update Javascript code size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Embed widget 静默丢弃回复:开启「删除思维链」后空 assistant 消息触发误判去重

2 participants