fix(rectification): keep a live analyzing step and drop the range-stop exits
A completed tool left only checkmarks under 正在分析, so the run looked stuck. The composer and scoring-card 先这样 buttons were unused early exits. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -33,6 +33,9 @@ export const RECTIFICATION_ACTIVITY_PROGRESS_LABELS: Readonly<Record<PublicRecti
|
||||
preparing_result: "正在准备结果…",
|
||||
};
|
||||
|
||||
/** Live label between a completed tool and the next tool or spoken answer. */
|
||||
export const RECTIFICATION_ANALYZING_LIVE_LABEL = "正在分析…";
|
||||
|
||||
export const RECTIFICATION_SLOW_STEP_MS = 45_000;
|
||||
export const RECTIFICATION_AGENT_ATTEMPT_TIMEOUT_MS = 210_000;
|
||||
export const RECTIFICATION_TIMEOUT_WARN_BEFORE_MS = 20_000;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import type { AgentActivityTraceItem } from "./agent-activity-trace.ts";
|
||||
import type { AgentActivityView } from "./chat-message-view.ts";
|
||||
import type { ConsultationTimelineRow } from "./consultation-run-timeline.ts";
|
||||
import type { ConsultationTimelineKind, ConsultationTimelineRow } from "./consultation-run-timeline.ts";
|
||||
import { RECTIFICATION_ANALYZING_LIVE_LABEL } from "./rectification-activity-labels.ts";
|
||||
import type { CompletedActivityReceiptView } from "./rectification-activity-receipt.ts";
|
||||
import { PUBLIC_RECTIFICATION_METHOD_LABELS } from "./rectification-varga-sentence.ts";
|
||||
|
||||
@@ -34,6 +35,12 @@ function isProgressLabel(label: string): boolean {
|
||||
return /^正在/.test(label.trim());
|
||||
}
|
||||
|
||||
function liveRowKind(phase: AgentActivityView["phase"] | undefined, label: string): ConsultationTimelineKind {
|
||||
if (phase === "answer-composition") return "write";
|
||||
if (label === RECTIFICATION_ANALYZING_LIVE_LABEL) return "think";
|
||||
return "calculate";
|
||||
}
|
||||
|
||||
/**
|
||||
* Project the rectification agent's tool trace and receipt onto the same
|
||||
* timeline rows the consultation surface renders, so both sessions share one
|
||||
@@ -76,10 +83,17 @@ export function rectificationTimelineRows(input: RectificationTimelineInput): Co
|
||||
if (!input.settled && !hasLiveRow && isProgressLabel(label)) {
|
||||
rows.push({
|
||||
id: RECTIFICATION_TIMELINE_LIVE_ID,
|
||||
kind: input.activity?.phase === "answer-composition" ? "write" : "calculate",
|
||||
kind: liveRowKind(input.activity?.phase, label),
|
||||
status: "live",
|
||||
label,
|
||||
});
|
||||
} else if (!input.settled && !hasLiveRow && rows.length > 0) {
|
||||
rows.push({
|
||||
id: RECTIFICATION_TIMELINE_LIVE_ID,
|
||||
kind: "think",
|
||||
status: "live",
|
||||
label: RECTIFICATION_ANALYZING_LIVE_LABEL,
|
||||
});
|
||||
}
|
||||
return rows;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user