From 32c83f0c106bbed2aba93ed83bc8511c144ef4b3 Mon Sep 17 00:00:00 2001 From: Bohdan Triapitsyn Date: Fri, 2 Jan 2026 22:03:10 +0200 Subject: [PATCH] feat(multirun): enforce maximum model selection limit and update UI hints --- packages/ui/src/components/multirun/MultiRunLauncher.tsx | 8 +++++++- packages/ui/src/stores/useMultiRunStore.ts | 5 +++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/packages/ui/src/components/multirun/MultiRunLauncher.tsx b/packages/ui/src/components/multirun/MultiRunLauncher.tsx index 4f705cdd..961ab393 100644 --- a/packages/ui/src/components/multirun/MultiRunLauncher.tsx +++ b/packages/ui/src/components/multirun/MultiRunLauncher.tsx @@ -31,6 +31,9 @@ import type { ModelMetadata } from '@/types'; /** Max file size in bytes (10MB) */ const MAX_FILE_SIZE = 10 * 1024 * 1024; +/** Max number of concurrent runs */ +const MAX_MODELS = 5; + /** Attached file for multi-run (simplified from sessionStore's AttachedFile) */ interface MultiRunAttachedFile { id: string; @@ -609,6 +612,9 @@ export const MultiRunLauncher: React.FC = ({ const handleAddModel = (model: ModelSelectionWithId) => { + if (selectedModels.length >= MAX_MODELS) { + return; + } setSelectedModels((prev) => [...prev, model]); clearError(); }; @@ -942,7 +948,7 @@ export const MultiRunLauncher: React.FC = ({
()( return null; } + if (models.length > 5) { + set({ error: 'Maximum 5 models allowed' }); + return null; + } + set({ isLoading: true, error: null }); try {