修复 Web Plan 模式计划内容展示#676
Open
Yumiue wants to merge 2 commits into
Open
Conversation
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
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.
关联问题
背景
#674 要解决的是 Web Plan 模式下计划内容不显示或显示异常:模型输出的结构化计划容易以 JSON/Markdown 普通文本形式泄漏到聊天流,刷新或切换会话后也无法稳定恢复为计划视图。
本 PR 同时包含一个超出 #674 原始范围但位于同一 Web 事件桥链路的修复:#675 记录
agent_done在没有预先流式 chunk 时不会创建 assistant 消息的问题。修改内容
Plan 展示链路
plan_spec + summary_candidate并更新CurrentPlan后发送plan_updated事件。current_plan,用于刷新、切会话和 checkpoint 恢复后的计划卡片还原。PlanArtifact / PlanSpec / PlanUpdatedPayload,事件类型增加plan_updated。agent_chunk计划 JSON,收到plan_updated后插入或更新计划卡片。current_plan还原计划卡片,并在已有 rendered plan 文本的位置替换,避免重复展示且保持原消息顺序。越界但相关的事件桥修复
agent_done携带最终文本但此前没有创建 streaming assistant 消息时,Web 会创建并 finalize 一条普通 assistant 消息。plan_updated的同一 run 在agent_done时仍跳过普通消息生成,避免计划卡片和 Markdown 重复。验证
npm test -- src/utils/eventBridge.test.ts src/stores/useSessionStore.test.ts src/components/chat/MessageItem.test.tsxgo test ./internal/gateway ./internal/runtime备注