fix(agent): handle task failure by displaying user-friendly error messages in conversation flow

This commit is contained in:
HouYunFei
2026-07-29 13:20:31 +08:00
parent 0f5eb1fbcb
commit ed32e44e69
6 changed files with 34 additions and 7 deletions
+1 -1
View File
@@ -145,7 +145,7 @@ export function startHttpServer() {
/** 将当前 turn 事件固定广播到实际线程。 */
const turnEmit = (type: string, payload: unknown) => {
const data = payload && typeof payload === "object" && !Array.isArray(payload) ? payload as Record<string, unknown> : { value: payload };
session.emitThread(type, threadId, data);
session.emitThread(type, threadId, { ...data, ...(turnId ? { turn_id: turnId } : {}) });
};
void runCodexTurn(withAttachmentContext(prompt, attachmentRefs), turnEmit, attachments, {
threadId,