fix: normalize workflow-result records to match ThreadRecord shape
Both REST and SSE endpoints now return workflow-result with standard fields (role, content, timestamp) instead of non-standard (summary). Fixes 'Invalid Date' and empty content in dashboard. 小橘 <xiaoju@shazhou.work>
This commit is contained in:
@@ -118,7 +118,7 @@ async function emitRecordsForHead(params: {
|
||||
params.eventId.n++;
|
||||
await params.stream.writeSSE({
|
||||
event: "record",
|
||||
data: JSON.stringify({ type: "workflow-result", ...wf }),
|
||||
data: JSON.stringify({ type: "workflow-result", role: null, content: wf.summary, timestamp: null, returnCode: wf.returnCode }),
|
||||
id: String(params.eventId.n),
|
||||
});
|
||||
return true;
|
||||
|
||||
@@ -42,7 +42,7 @@ async function buildThreadDetailRecords(
|
||||
const returnCode = fr.payload.meta.returnCode;
|
||||
const summary = fr.payload.meta.summary;
|
||||
if (typeof returnCode === "number" && typeof summary === "string") {
|
||||
records.push({ type: "workflow-result", returnCode, summary });
|
||||
records.push({ type: "workflow-result", role: null, content: summary, timestamp: null, returnCode });
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user