fix: deduplicate workbench requests and remove unused map paths
This commit is contained in:
@@ -956,19 +956,15 @@ function MapWorkbenchContent({
|
||||
}
|
||||
|
||||
async function handleStartNewAgentSession() {
|
||||
mapController.clearScadaAnalysis();
|
||||
await agent.startNewSession();
|
||||
}
|
||||
|
||||
async function handleLoadAgentHistorySession(sessionId: string) {
|
||||
const changesSession = sessionId !== agent.sessionId;
|
||||
const loaded = await agent.loadHistorySession(sessionId);
|
||||
if (!loaded) throw new Error("会话打开已取消");
|
||||
if (changesSession) mapController.clearScadaAnalysis();
|
||||
}
|
||||
|
||||
async function handleOpenTaskCollaboration(taskId: string, discussion?: InvestigationDiscussion) {
|
||||
mapController.clearScadaAnalysis();
|
||||
const id = await agent.openTaskCollaboration(taskId, discussion);
|
||||
if (discussion?.reference && id) agent.setContentReference(discussion.reference);
|
||||
readingWorkspace?.close();
|
||||
@@ -980,7 +976,6 @@ function MapWorkbenchContent({
|
||||
target: TaskExecutionHistoryTarget,
|
||||
knownRunId?: string
|
||||
) {
|
||||
mapController.clearScadaAnalysis();
|
||||
let runId = knownRunId;
|
||||
if (!runId) {
|
||||
const runs = await fetchOperationalTaskRuns(taskId, getAccessToken);
|
||||
@@ -999,12 +994,8 @@ function MapWorkbenchContent({
|
||||
}
|
||||
|
||||
async function handleDeleteAgentHistorySession(sessionId: string) {
|
||||
const clearsActiveAnalysis = sessionId === agent.sessionId;
|
||||
const deleted = await agent.deleteHistorySession(sessionId);
|
||||
if (!deleted) throw new Error("会话删除失败,请重试");
|
||||
if (deleted && clearsActiveAnalysis) {
|
||||
mapController.clearScadaAnalysis();
|
||||
}
|
||||
}
|
||||
|
||||
async function handleAgentMapAction(
|
||||
|
||||
Reference in New Issue
Block a user