fix(agent): 主 Agent 每个会话均可交互,修实时徽章滞留
上一版把非当前段设为只读、且仅当前段可发消息,与"像会话页一样在任一 会话都能对话"的诉求不符;同时实时徽章改用 recentLive 后,turn 结束仍 会在 5s 窗口内继续显示"实时流式中"。 - server: chat 接口接收目标段 seg,消息写到用户正在看的会话段(缺省=最新段) - web: 去掉只读/当前/历史区分,任一主 Agent 会话都可直接对话;send 带 seg - web: 实时徽章改回按真实运行状态(sending/mainChatRunning)判断,且收到 终结记录(result/报错)即刻熄灭;输入框同样在终结记录后立即解禁
This commit is contained in:
1 parent
b4bbe612df
commit
6b59d4126e
4 files changed
+57
-50
No files matched your search
+2
-2
@@ -721,8 +721,8 @@ export const api = {
|
||||
if (!r.ok) throw new Error(`report: ${r.status}`);
|
||||
return r.text();
|
||||
},
|
||||
chat: (message: string, task?: string, attachments?: ChatAttachment[]) =>
|
||||
post<{ reply: string; mode: string }>(`/chat${tq(task)}`, { message, attachments }),
|
||||
chat: (message: string, task?: string, attachments?: ChatAttachment[], seg?: number) =>
|
||||
post<{ reply: string; mode: string }>(`/chat${tq(task)}`, { message, attachments, seg }),
|
||||
chatStatus: (taskId: string) => get<{ running: boolean }>(`/tasks/${taskId}/chat/status`),
|
||||
// 方式1 文件上传:落到会话/任务工作目录 uploads/,返回可供 agent Read 的相对路径。
|
||||
chatUpload: async (scope: "task" | "session" | "staging", id: string, files: File[]) => {
|
||||
|
||||
@@ -831,7 +831,6 @@ export interface Session {
|
||||
source_task_id?: string;
|
||||
inherited?: boolean;
|
||||
seg?: number; // main-agent session: which conversation segment (0 = original)
|
||||
isCurrentMain?: boolean; // main-agent session: the writable current segment
|
||||
}
|
||||
|
||||
// ---- Security ----
|
||||
|
||||
Reference in new issue
Block a user