feat: increase batch size limits to 15 and add testing_batch_size setting

Batch size configuration:
- Increase coding agent batch size limit from 1-3 to 1-15
- Increase testing agent batch size limit from 1-5 to 1-15
- Add separate `testing_batch_size` setting (previously only CLI-configurable)
- Pass testing_batch_size through full stack: schema → settings router →
  agent router → process manager → CLI flag

UI changes:
- Replace 3-button batch size selector with range slider (1-15)
- Add new Slider component (ui/src/components/ui/slider.tsx)
- Add "Features per Testing Agent" slider in settings panel
- Add custom slider CSS styling for webkit and mozilla

Updated across: CLAUDE.md, autonomous_agent_demo.py, parallel_orchestrator.py,
server/{schemas,routers,services}, and UI types/hooks/components.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Auto
2026-03-20 13:39:19 +02:00
parent 7f875c3bbd
commit 8b2251331d
12 changed files with 172 additions and 37 deletions

View File

@@ -10,6 +10,7 @@ import {
DialogTitle,
} from '@/components/ui/dialog'
import { Switch } from '@/components/ui/switch'
import { Slider } from '@/components/ui/slider'
import { Label } from '@/components/ui/label'
import { Alert, AlertDescription } from '@/components/ui/alert'
import { Button } from '@/components/ui/button'
@@ -63,6 +64,12 @@ export function SettingsModal({ isOpen, onClose }: SettingsModalProps) {
}
}
const handleTestingBatchSizeChange = (size: number) => {
if (!updateSettings.isPending) {
updateSettings.mutate({ testing_batch_size: size })
}
}
const handleProviderChange = (providerId: string) => {
if (!updateSettings.isPending) {
updateSettings.mutate({ api_provider: providerId })
@@ -432,28 +439,34 @@ export function SettingsModal({ isOpen, onClose }: SettingsModalProps) {
</div>
</div>
{/* Features per Agent */}
{/* Features per Coding Agent */}
<div className="space-y-2">
<Label className="font-medium">Features per Agent</Label>
<Label className="font-medium">Features per Coding Agent</Label>
<p className="text-sm text-muted-foreground">
Number of features assigned to each coding agent
Number of features assigned to each coding agent session
</p>
<div className="flex rounded-lg border overflow-hidden">
{[1, 2, 3].map((size) => (
<button
key={size}
onClick={() => handleBatchSizeChange(size)}
disabled={isSaving}
className={`flex-1 py-2 px-3 text-sm font-medium transition-colors ${
(settings.batch_size ?? 1) === size
? 'bg-primary text-primary-foreground'
: 'bg-background text-foreground hover:bg-muted'
} ${isSaving ? 'opacity-50 cursor-not-allowed' : ''}`}
>
{size}
</button>
))}
</div>
<Slider
min={1}
max={15}
value={settings.batch_size ?? 3}
onChange={handleBatchSizeChange}
disabled={isSaving}
/>
</div>
{/* Features per Testing Agent */}
<div className="space-y-2">
<Label className="font-medium">Features per Testing Agent</Label>
<p className="text-sm text-muted-foreground">
Number of features assigned to each testing agent session
</p>
<Slider
min={1}
max={15}
value={settings.testing_batch_size ?? 3}
onChange={handleTestingBatchSizeChange}
disabled={isSaving}
/>
</div>
{/* Update Error */}

View File

@@ -0,0 +1,44 @@
import * as React from "react"
import { cn } from "@/lib/utils"
interface SliderProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'onChange'> {
min: number
max: number
value: number
onChange: (value: number) => void
label?: string
}
function Slider({
className,
min,
max,
value,
onChange,
disabled,
...props
}: SliderProps) {
return (
<div className={cn("flex items-center gap-3", className)}>
<input
type="range"
min={min}
max={max}
value={value}
onChange={(e) => onChange(Number(e.target.value))}
disabled={disabled}
className={cn(
"slider-input h-2 w-full cursor-pointer appearance-none rounded-full bg-input transition-colors",
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
disabled && "cursor-not-allowed opacity-50"
)}
{...props}
/>
<span className="min-w-[2ch] text-center text-sm font-semibold tabular-nums">
{value}
</span>
</div>
)
}
export { Slider }

View File

@@ -302,6 +302,7 @@ const DEFAULT_SETTINGS: Settings = {
testing_agent_ratio: 1,
playwright_headless: true,
batch_size: 3,
testing_batch_size: 3,
api_provider: 'claude',
api_base_url: null,
api_has_auth_token: false,

View File

@@ -579,7 +579,8 @@ export interface Settings {
ollama_mode: boolean
testing_agent_ratio: number // Regression testing agents (0-3)
playwright_headless: boolean
batch_size: number // Features per coding agent batch (1-3)
batch_size: number // Features per coding agent batch (1-15)
testing_batch_size: number // Features per testing agent batch (1-15)
api_provider: string
api_base_url: string | null
api_has_auth_token: boolean
@@ -592,6 +593,7 @@ export interface SettingsUpdate {
testing_agent_ratio?: number
playwright_headless?: boolean
batch_size?: number
testing_batch_size?: number
api_provider?: string
api_base_url?: string
api_auth_token?: string

View File

@@ -1472,3 +1472,53 @@
::-webkit-scrollbar-thumb:hover {
background: var(--muted-foreground);
}
/* ============================================================================
Slider (range input) styling
============================================================================ */
.slider-input::-webkit-slider-thumb {
-webkit-appearance: none;
appearance: none;
width: 16px;
height: 16px;
border-radius: 50%;
background: var(--primary);
border: 2px solid var(--primary-foreground);
box-shadow: var(--shadow-sm);
cursor: pointer;
transition: transform 150ms, box-shadow 150ms;
}
.slider-input::-webkit-slider-thumb:hover {
transform: scale(1.15);
box-shadow: var(--shadow);
}
.slider-input::-moz-range-thumb {
width: 16px;
height: 16px;
border-radius: 50%;
background: var(--primary);
border: 2px solid var(--primary-foreground);
box-shadow: var(--shadow-sm);
cursor: pointer;
transition: transform 150ms, box-shadow 150ms;
}
.slider-input::-moz-range-thumb:hover {
transform: scale(1.15);
box-shadow: var(--shadow);
}
.slider-input::-webkit-slider-runnable-track {
height: 8px;
border-radius: 9999px;
background: var(--input);
}
.slider-input::-moz-range-track {
height: 8px;
border-radius: 9999px;
background: var(--input);
}