Repository navigation
fix(assistant): 连续通话回复不再跨轮覆盖,流式输出时可以上滑 - #393
Merged
yyy-router merged 3 commits intoAug 27, 2026
Merged
yyy-router merged 3 commits into
yyy-router merged 3 commits into
Conversation
连续模式没有 per-turn request_id,回复只能按到达顺序归属到"当前轮"。 之前只用"最后一条轮次"兜底,一旦回复先于自己的转写到达(转写晚到,或 用户开口打断了正在播的上一轮),后一条回复会直接覆盖前一条已完成的 回复,历史记录里出现两条一样的答案。 现在引入占位轮机制:只有最后一条轮次还在等回复时,新回复才写进它; 一旦发现它已经收尾,新回复会开一个没有转写的占位轮,等它自己的转写 到达再合并。voice.tts.canceled(用户打断)这条路径之前漏了同一个 收尾标记,导致打断后下一轮抢跑的回复会覆盖被打断轮次的部分回复, 这次一并补上。
连续模式麦克风常开,安静时的环境噪音也会让声纹球一直小幅跳动,回答 结束后看起来像还在说话;现在只在真正说话,或听声时电平超过阈值才 画波形。 对白列表的贴底滚动之前依赖 onScroll 判断是否贴底,会把程序化的 scrollToEnd() 误认成用户手动划走,改成只在真实手势结束时判定。但 排队跳底和真正执行隔着两帧 requestAnimationFrame,执行前没有复查 用户是否已经开始拖动——流式吐字期间这个窗口几乎连续重开,用户完全 无法上滑。这次在执行前补上复查。
Codecov Report✅ All modified and coverable lines are covered by tests.
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 37 files with indirect coverage changes 🚀 New features to boost your workflow:
|
Codecov 标出 AssistantContinuousConversationService.ts 补丁覆盖率 88.57%,缺口集中在 voice.dialogue.question 在 turns 为空时走 upsertOrphanQuestion 兜底的分支——之前只测了 voice.dialogue.reply 的同类兜底,追问那条一直没人测。补上"追问先于转写到达"(含同一个 question_id 二次到达要原地更新,不能变成两条气泡)和两处"文字全是 空白就不建气泡"的边界。
yyy-router
approved these changes
Aug 27, 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
而是开占位轮等自己的转写补上;
voice.tts.canceled(打断)路径补上同一个收尾标记,防止打断后下一轮的回复覆盖被打断轮次。
scrollToEnd()前复查一次交互状态,修复流式输出期间无法上滑、被强制拽回底部的问题。
Fixes #392
Test plan
Verification
cd frontend npx jest --runInBand tests/unit/features/assistant本地结果:
Test Suites: 11 passed,Tests: 139 passed。