fix(teacher): 隔离子智能体流式消息与老师正文

This commit is contained in:
2026-09-23 10:25:43 +08:00
parent 3fe98fc565
commit d20c818fe7
4 changed files with 73 additions and 7 deletions

View File

@@ -308,6 +308,7 @@ export function prepareCloudTeacher(
typeof detail === 'string' ? detail : '老师回复已停止。'
);
}
const threadId = identifier(view.thread_id);
onProgress('老师正在思考…');
try {
await transport.events(
@@ -318,6 +319,8 @@ export function prepareCloudTeacher(
bounded,
(_event, envelope, id) => {
if (id) cursor = id;
// Yuxi 的父 Run 也包含子线程事件,老师正文只接收云端主线程文本。
if (envelope.thread_id !== threadId) return;
const payload = envelope.payload ? object(envelope.payload) : {};
for (const item of Array.isArray(payload.items)
? payload.items