根因:ConversationSection 同时渲染 TracePanel(prompt + 全部链路条目)和 ContinuePanel(GET /chat-history, 服务端已把 prompt + 继续 + 后续 + 全部链路种类按时间 合并、并去掉了后续消息回声),简单任务的两份名单 显示同一组用户 + 助手卡片,看起来就是对话重复。 改法:删 TracePanel 名单,只留 ContinuePanel 这一列; TracePanel 唯一不重复的控件(链路类型筛选、下载完整 链路)移到这一列顶部,筛选只过滤链路消息、用户消息 恒保留;实时性不丢:基础是 10 秒轮询的 chat-history, SSE 新链路条目按 id 去重合并进来,轮询拿到后不再 重复;无 chat-history 的旧服务端回退路径也改成渲染 全部链路种类(不再只渲染 message),并跳过 fu- 回声。
25 lines
920 B
TypeScript
25 lines
920 B
TypeScript
import { useConsole } from "../context";
|
|
import ContinuePanel from "./detail/ContinuePanel";
|
|
|
|
// Dashboard conversation section: ONE ChatGPT-style conversation column
|
|
// (ContinuePanel). It used to render TracePanel above it, which showed
|
|
// the same user + assistant pair a second time, because chat-history
|
|
// already merges every trace kind into the conversation. Dispatch
|
|
// lives in its own section above on the same page, so it is NOT
|
|
// duplicated here when no task is selected — only the hint.
|
|
export default function ConversationSection() {
|
|
const ctx = useConsole();
|
|
if (!ctx.currentTask) {
|
|
return (
|
|
<div className="conversation">
|
|
<div className="muted">在任务列表里点一条任务,对话和详情就切到该任务;也可以在上面派发一个新任务。</div>
|
|
</div>
|
|
);
|
|
}
|
|
return (
|
|
<div className="conversation">
|
|
<ContinuePanel />
|
|
</div>
|
|
);
|
|
}
|