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
+26
View File
@@ -174,6 +174,8 @@ export type AgentApiClient = InteractionRequestApi & {
moveSessionToTopic: (sessionId: string, topicId: string | null) => Promise<void>;
loadOlderMessages: (sessionId: string, before: string, signal?: AbortSignal) => Promise<AgentHistoryMessagePage>;
createTaskCollaborationSession: (taskId: string) => Promise<AgentChatSession>;
createTaskExecutionDebugSession: (taskId: string, runId: string, sessionId: string) => Promise<AgentChatSession>;
loadTaskExecutionSession: (taskId: string, runId: string, sessionId: string, signal?: AbortSignal) => Promise<AgentLoadedChatSession | null>;
loadSession: (sessionId: string, options?: { messageLimit?: number; signal?: AbortSignal }) => Promise<AgentLoadedChatSession | null>;
streamSession: (
sessionId: string,
@@ -365,6 +367,30 @@ export function createAgentApiClient(
);
},
async createTaskExecutionDebugSession(taskId, runId, sessionId) {
return requestJson<AgentChatSession>(
`/task/${encodeURIComponent(taskId)}/execution-session/debug`,
{
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ run_id: runId, session_id: sessionId })
}
);
},
async loadTaskExecutionSession(taskId, runId, sessionId, signal) {
const query = new URLSearchParams({ run_id: runId, session_id: sessionId });
const response = await request(
`/task/${encodeURIComponent(taskId)}/execution-session?${query}`,
{ signal }
);
const text = await response.text();
const data = text ? JSON.parse(text) : null;
if (response.status === 404) return null;
if (!response.ok) throw new Error(getResponseErrorMessage(data, response.status));
return toLoadedSession(data);
},
async getFrontendActionRegistry() {
return requestJson<unknown>("/frontend-action-registry");
},