修复agents历史记录跳转

This commit is contained in:
2025-10-11 13:00:52 +08:00
parent 6aefec3312
commit e7775ce8ed
8 changed files with 53 additions and 40 deletions

View File

@@ -98,12 +98,19 @@ export const AgentRunsList: React.FC<AgentRunsListProps> = ({
};
const handleRunClick = (run: AgentRunWithMetrics) => {
if (!run.id) {
console.error('[AgentRunsList] Cannot open run - no ID available:', run);
return;
}
// If there's a callback, use it (for full-page navigation)
if (onRunClick) {
onRunClick(run);
} else if (run.id) {
} else {
// Otherwise, open in new tab
createAgentTab(run.id.toString(), run.agent_name);
const tabId = createAgentTab(run.id.toString(), run.agent_name);
window.dispatchEvent(new CustomEvent('switch-to-tabs', { detail: { tabId } }));
}
};
@@ -215,4 +222,4 @@ export const AgentRunsList: React.FC<AgentRunsListProps> = ({
</>
);
};
};