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 {