fix: preserve investigation execution history by round

This commit is contained in:
2026-10-30 17:07:53 +08:00
parent 1ee21d1c7f
commit 185bf31446
16 changed files with 830 additions and 32 deletions
@@ -18,6 +18,7 @@ import {
CheckCircle2,
ChevronDown,
ChevronLeft,
Eye,
History,
LoaderCircle,
Pause,
@@ -153,6 +154,7 @@ type AgentCommandPanelProps = {
onRetryPromptSuggestions?: () => void;
activeSessionId?: string | null;
qaOnly?: boolean;
executionHistory?: boolean;
statusLabel?: string;
connectionStatus?: AgentConnectionStatus;
streaming?: boolean;
@@ -220,6 +222,7 @@ export function AgentCommandPanel({
onRetryPromptSuggestions,
activeSessionId,
qaOnly = false,
executionHistory = false,
connectionStatus = "connecting",
streaming = false,
inputDelivery = "steer",
@@ -561,6 +564,7 @@ export function AgentCommandPanel({
onResumeSpeech={resumeSpeech}
onStopSpeech={stopSpeech}
qaOnly={qaOnly}
showProcess={!qaOnly || executionHistory}
onLocateAnswerFeatures={onLocateAnswerFeatures}
onSubmitAnswerForm={onSubmitPrompt}
onAsk={(selection) => {
@@ -603,6 +607,15 @@ export function AgentCommandPanel({
: "border-t border-[var(--surface-divider)] p-3"
)}
>
{executionHistory ? (
<div role="note" className="agent-panel-control mb-1 flex min-h-14 items-center gap-2.5 rounded-xl px-3 py-2 text-sm">
<Eye className="size-4 shrink-0 text-muted-foreground" aria-hidden />
<div className="min-w-0">
<p className="font-medium text-foreground">执行记录自动同步</p>
<p className="text-xs leading-5 text-muted-foreground">发送消息后进入独立调试会话,系统执行记录不会被修改。</p>
</div>
</div>
) : null}
{centeredComposer && !promptReference ? (
<ConversationEmptyState className="agent-chat-empty-state">
<h2 className="text-2xl font-medium tracking-tight text-foreground">有什么可以帮你?</h2>
@@ -1265,6 +1278,7 @@ type BackendMessageListProps = {
onResumeSpeech: () => void;
onStopSpeech: () => void;
qaOnly: boolean;
showProcess: boolean;
onLocateAnswerFeatures?: (target: AnswerUiMapTarget) => Promise<unknown> | void;
onSubmitAnswerForm: (text: string) => Promise<void> | void;
onAsk?: (selection: AnswerUiSelection) => void;
@@ -1329,6 +1343,7 @@ function BackendMessage({
onResumeSpeech,
onStopSpeech,
qaOnly,
showProcess,
onLocateAnswerFeatures,
onSubmitAnswerForm,
onAsk,
@@ -1366,10 +1381,9 @@ function BackendMessage({
processMessages.some(
(source) =>
getAnswerPresentation(source).process.length > 0 ||
(!qaOnly &&
(source.progress?.length ||
(!hasPendingMessageInput(source) &&
(source.todos?.todos.length || source.permissions?.length || source.questions?.length)))),
(showProcess && source.progress?.length) ||
(!qaOnly && !hasPendingMessageInput(source)
&& (source.todos?.todos.length || source.permissions?.length || source.questions?.length)),
);
const hasProcessError = processMessages.some((source) => source.progress?.some((item) => item.status === "error"));
return (
@@ -1485,6 +1499,7 @@ function BackendMessage({
<AgentMessageProcessContent
messages={processMessages}
qaOnly={qaOnly}
showProgress={showProcess}
runningMessageId={!completed ? message.id : undefined}
/>
</AgentProcessDisclosure>