Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 10 additions & 46 deletions web/src/components/projects/project-general-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ interface Project {
maxIterations: number | null;
watchdogTimeoutMs: number | null;
progressModel: string | null;
progressIntervalMinutes: string | null;
workItemBudgetUsd: string | null;
agentEngine: string | null;
engineSettings: Record<string, Record<string, unknown>> | null;
Expand All @@ -60,13 +59,6 @@ function minutesToMs(minutes: string): number | null {
return Number.isNaN(parsed) ? null : parsed * 60000;
}

/** Convert a DB interval value (may be "5.0") to integer string for display */
function intervalToInteger(value: string | null | undefined): string {
if (!value) return '';
const n = Math.round(Number(value));
return Number.isNaN(n) ? '' : String(n);
}

export function ProjectGeneralForm({ project }: { project: Project }) {
const navigate = useNavigate();
const queryClient = useQueryClient();
Expand Down Expand Up @@ -96,9 +88,6 @@ export function ProjectGeneralForm({ project }: { project: Project }) {
const [name, setName] = useState(project.name);
const [watchdogMinutes, setWatchdogMinutes] = useState(msToMinutes(project.watchdogTimeoutMs));
const [progressModel, setProgressModel] = useState(project.progressModel ?? '');
const [progressIntervalMinutes, setProgressIntervalMinutes] = useState(
intervalToInteger(project.progressIntervalMinutes),
);
const [workItemBudgetUsd, setWorkItemBudgetUsd] = useState(project.workItemBudgetUsd ?? '');
const [maxInFlightItems, setMaxInFlightItems] = useState(
numericFieldDefault(project.maxInFlightItems),
Expand All @@ -111,7 +100,6 @@ export function ProjectGeneralForm({ project }: { project: Project }) {
name !== project.name ||
watchdogMinutes !== msToMinutes(project.watchdogTimeoutMs) ||
progressModel !== (project.progressModel ?? '') ||
progressIntervalMinutes !== intervalToInteger(project.progressIntervalMinutes) ||
workItemBudgetUsd !== (project.workItemBudgetUsd ?? '') ||
maxInFlightItems !== numericFieldDefault(project.maxInFlightItems) ||
runLinksEnabled !== (project.runLinksEnabled ?? false)
Expand All @@ -120,7 +108,6 @@ export function ProjectGeneralForm({ project }: { project: Project }) {
name,
watchdogMinutes,
progressModel,
progressIntervalMinutes,
workItemBudgetUsd,
maxInFlightItems,
runLinksEnabled,
Expand All @@ -131,7 +118,6 @@ export function ProjectGeneralForm({ project }: { project: Project }) {
setName(project.name);
setWatchdogMinutes(msToMinutes(project.watchdogTimeoutMs));
setProgressModel(project.progressModel ?? '');
setProgressIntervalMinutes(intervalToInteger(project.progressIntervalMinutes));
setWorkItemBudgetUsd(project.workItemBudgetUsd ?? '');
setMaxInFlightItems(numericFieldDefault(project.maxInFlightItems));
setRunLinksEnabled(project.runLinksEnabled ?? false);
Expand All @@ -144,7 +130,6 @@ export function ProjectGeneralForm({ project }: { project: Project }) {
name,
watchdogTimeoutMs: minutesToMs(watchdogMinutes),
progressModel: progressModel || null,
progressIntervalMinutes: progressIntervalMinutes || null,
workItemBudgetUsd: workItemBudgetUsd || null,
maxInFlightItems: maxInFlightItems ? Number.parseInt(maxInFlightItems, 10) : null,
runLinksEnabled,
Expand Down Expand Up @@ -173,9 +158,6 @@ export function ProjectGeneralForm({ project }: { project: Project }) {
const watchdogDescription =
watchdogDefaultMinutes != null ? `Default: ${watchdogDefaultMinutes} min` : '…';
const progressModelPlaceholder = defaults ? defaults.progressModel : 'e.g. gemini-flash';
const progressIntervalPlaceholder = defaults
? `${defaults.progressIntervalMinutes} (default)`
: 'e.g. 5';

return (
<TooltipProvider>
Expand Down Expand Up @@ -288,34 +270,16 @@ export function ProjectGeneralForm({ project }: { project: Project }) {
</div>
</CardHeader>
<CardContent className="space-y-4">
<div className="grid grid-cols-2 gap-4">
<div className="space-y-2">
<Label htmlFor="progressModel">Progress Model</Label>
<OpenRouterModelCombobox
id="progressModel"
projectId={project.id}
value={progressModel}
onChange={setProgressModel}
placeholder={progressModelPlaceholder}
/>
<p className="text-xs text-muted-foreground">LLM model for progress summaries.</p>
</div>
<div className="space-y-2">
<Label htmlFor="progressIntervalMinutes">Progress Interval (min)</Label>
<Input
id="progressIntervalMinutes"
type="number"
min="1"
step="1"
className="w-32"
value={progressIntervalMinutes}
onChange={(e) => setProgressIntervalMinutes(e.target.value)}
placeholder={progressIntervalPlaceholder}
/>
<p className="text-xs text-muted-foreground">
How often the agent posts a progress update.
</p>
</div>
<div className="space-y-2">
<Label htmlFor="progressModel">Progress Model</Label>
<OpenRouterModelCombobox
id="progressModel"
projectId={project.id}
value={progressModel}
onChange={setProgressModel}
placeholder={progressModelPlaceholder}
/>
<p className="text-xs text-muted-foreground">LLM model for progress summaries.</p>
</div>
<div className="flex items-center gap-3">
<input
Expand Down
8 changes: 7 additions & 1 deletion web/src/components/settings/agent-config-form-dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,13 @@ export function AgentConfigFormDialog({ open, onOpenChange, config }: AgentConfi
</div>
<div className="space-y-2">
<Label htmlFor="gac-model">Model</Label>
<ModelField id="gac-model" value={model} onChange={setModel} engine={agentEngine} />
<ModelField
id="gac-model"
value={model}
onChange={setModel}
engine={agentEngine}
projectId={config?.projectId}
/>
</div>
{effectiveEngine && (
<EngineSettingsFields
Expand Down
2 changes: 1 addition & 1 deletion web/src/components/ui/combobox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export function Combobox({
</PopoverPrimitive.Trigger>
<PopoverPrimitive.Portal>
<PopoverPrimitive.Content
className="z-50 w-[var(--radix-popover-trigger-width)] rounded-md border bg-popover p-0 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95"
className="z-50 min-w-[var(--radix-popover-trigger-width)] w-max max-w-[600px] rounded-md border bg-popover p-0 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95"
sideOffset={4}
align="start"
>
Expand Down
Loading