fix: streaming tool call rendering truncated during execution - #834
Conversation
Replace the char-arrival-triggered BatchNodeUpdater with a RenderBatchCoordinator that tracks revision numbers, ensuring mutations occurring during an active flush are not lost. Key changes: - Add RenderBatchCoordinator with revision-based coalescing loop - Call requestUpdate() after every renderable state mutation (node creation, content append, child node changes, XML stream registration, HTML break nodes, latex node replacement) - Replace BatchNodeUpdater.startBatchUpdates() with RenderBatchCoordinator.requestUpdate(); the loop drains all pending revisions before going idle - Introduce BatchNodeUpdater.appendBlockChunk() to atomically append content and request a render update for XML/text blocks Resolves: streaming tool call cards display truncated parameters during execution; full parameters only appear after tool completion.
|
The The script The mismatch comes from an extra This PR does not modify |
|
Post-fix verification on device This fix was verified on a Redmi K80 Pro (HyperOS 3 / Android 15) running a personal build (
The personal/dev branch contains additional features and optimizations beyond this fix. However, the fix itself is self-contained — the 3 files in this PR ( |
|
Nightly build with fix applied A nightly build containing this fix is available for testing: https://github.com/CATMIAOZHI/OperitNightlyRelease/releases/tag/v1.12.0%2B4-ry.1-dev.127 This build was used for the on-device verification mentioned above. |
|
Ci不用管 |
待会儿可能要发+5补丁,我看一下来得及的话就合,来不及的话就等一下 |
变更说明 / Description
流式输出期间,工具调用卡片的参数渲染会被截断,直到工具执行结束后才补全。此 PR 用基于 revision 的
RenderBatchCoordinator替换原有的字符到达触发批量更新逻辑,确保渲染节点变更不会丢失。背景与动机 / Context and motivation
详见 #833。开启流式输出时,
BatchNodeUpdater.startBatchUpdates()在已有刷新任务运行时直接return,导致后续的节点变更(如工具 XML block 的command参数后半部分)不会被同步到renderNodes。工具实际收到的参数是完整的,但 UI 卡片在执行期间显示不完整。改动范围 / Changes
RenderBatchCoordinator:revision-based 批量渲染协调器,循环 drain 所有 pending revision 后才退出StreamMarkdownRenderer:在每次可渲染状态变更后调用requestUpdate(),替换原来的startBatchUpdates();新增appendBlockChunk()原子化追加 block 内容并请求渲染RenderBatchCoordinatorTest:3 个单元测试覆盖 coalescing、drain-on-exit 和 tool XML tail mutation 场景不包含:打字机动画、主题偏好、Canvas 渲染器等其他改动。
兼容性与风险 / Compatibility and risks
RenderBatchCoordinator为internal类,不影响公开 API关联 Issue / Related issue
Fixes #833
验证方式 / Verification
证据 / Evidence
修复前截图见 #833。
检查清单 / Checklist
Candidate checks覆盖改动范围,并会处理技术失败项 /Candidate checkscovers the change scope and technical failures will be addressed