fix(agent): 流式最终输出脱离过程区并降低布局压力【已审核 PR】 - #1736
Merged
ErlichLiu merged 2 commits intoAug 19, 2026
Merged
Conversation
Made-with: Proma
Made-with: Proma
ErlichLiu
force-pushed
the
fix/agent-streaming-output-202608181405
branch
from
August 19, 2026 08:48
9e4f975 to
ac05137
Compare
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.
概述
本 PR 优化 Agent 流式输出的展示方式:当 Agent 开始生成最终文本时,文本会立即脱离受限的执行过程区域,使用正常的 Markdown 消息布局持续渲染。同时将执行过程区域的最大高度从 320px 提升到 500px,并减少仅最终文本 token 更新时无效的滚动布局测量。
改动
apps/electron/src/renderer/components/agent/ProcessBlockGroup.tsx— 移除必须等待工具结果完成后才外置尾部文本的限制,让流式尾部text立即进入普通消息布局。apps/electron/src/renderer/components/agent/ProcessBlockGroup.tsx— 将执行过程区域最大高度调整为500px,保留内部滚动和原有折叠行为。apps/electron/src/renderer/components/agent/ProcessBlockGroup.tsx— 根据 content block 对象引用稳定化过程块数组,使外置最终文本的 token 更新不会重复触发过程区的useLayoutEffect、尺寸读取和滚动跟随。apps/electron/src/renderer/components/agent/SDKMessageRenderer.tsx— 移除不再需要的工具结果完成状态依赖,简化流式 render item 构建。apps/electron/package.json— 将@proma/electronpatch 版本从0.17.42升至0.17.43。测试方法
bun run --filter='@proma/electron' typecheckbun run --filter='@proma/electron' build:renderergit diff --check审核结论
备注
新增的临时
ProcessBlockGroup.test.ts测试文件已按需求删除,本 PR 不包含该测试文件。当前 PR 仅包含 3 个已跟踪源码/版本文件。Made with Proma · GitHub