fix: 区分助手实时进度与最终正文

This commit is contained in:
root
2026-07-12 10:10:07 +02:00
parent 352f359749
commit f90da964f5
11 changed files with 110 additions and 27 deletions
+2 -2
View File
@@ -633,7 +633,7 @@ export function summarizeQueueAttemptListResult(result: JsonValue, taskId: strin
function summarizeRunEvent(event: JsonRecord, summaryChars: number): JsonRecord {
const payload = jsonRecordValue(event.payload) ?? {};
const type = stringValue(event.type) ?? "unknown";
const messageEvent = type === "user_message" || type === "assistant_message";
const messageEvent = type === "user_message" || type === "assistant_progress" || type === "assistant_message";
const command = messageEvent ? null : boundedSummaryString(stringValue(payload.command), Math.min(summaryChars, 240));
const text = messageEvent ? boundedSummaryString(stringValue(payload.text), summaryChars) : null;
const outputSummary = boundedSummaryString(stringValue(payload.outputSummary) ?? nestedSummaryText(payload), summaryChars);
@@ -668,7 +668,7 @@ function summarizeRunEvent(event: JsonRecord, summaryChars: number): JsonRecord
function isDefaultVisibleSessionEvent(item: JsonRecord): boolean {
const type = stringValue(item.type);
return type === "user_message" || type === "assistant_message" || type === "tool_call" || type === "error";
return type === "user_message" || type === "assistant_progress" || type === "assistant_message" || type === "tool_call" || type === "error";
}
function summarizeSuppressedSessionEvents(all: JsonRecord[], visible: JsonRecord[]): JsonRecord {