diff --git a/apps/web/src/components/reviewSweep/ReviewSweepView.tsx b/apps/web/src/components/reviewSweep/ReviewSweepView.tsx index da36508066..2884095ef5 100644 --- a/apps/web/src/components/reviewSweep/ReviewSweepView.tsx +++ b/apps/web/src/components/reviewSweep/ReviewSweepView.tsx @@ -32,6 +32,7 @@ import { } from "../../providerInstances"; import { primaryServerProvidersAtom } from "../../state/server"; import { ProviderModelPicker } from "../chat/ProviderModelPicker"; +import { TraitsPicker } from "../chat/TraitsPicker"; import { applyAllSweepRecommendations, applySweepSettle, @@ -433,6 +434,7 @@ export function SweepPreRunSummary({ onStarted }: { onStarted?: () => void } = { ); const activeInstanceId = selectedModel?.instanceId ?? instanceEntries[0]?.instanceId ?? null; const activeModel = selectedModel?.model ?? instanceEntries[0]?.models[0]?.slug ?? ""; + const activeOptions = selectedModel?.options ?? []; const modelOptionsByInstance = useMemo( () => activeInstanceId === null @@ -440,6 +442,9 @@ export function SweepPreRunSummary({ onStarted }: { onStarted?: () => void } = { : getCustomModelOptionsByInstance(settings, serverProviders, activeInstanceId, activeModel), [activeInstanceId, activeModel, serverProviders, settings], ); + const activeInstanceEntry = instanceEntries.find( + (entry) => entry.instanceId === activeInstanceId, + ); const { candidateCount, reviewedCount, modelsByEnvironment } = useMemo(() => { const now = sweepNowIso(); @@ -520,21 +525,50 @@ export function SweepPreRunSummary({ onStarted }: { onStarted?: () => void } = { ))} ) : null} -
+
Review with {activeInstanceId !== null ? ( - { - setSweepModelSelection(createModelSelection(instanceId, model)); - }} - /> + <> + { + // Carry the current traits across a model switch when the + // instance is unchanged; a different instance's options + // aren't transferable, so start clean there. + setSweepModelSelection( + createModelSelection( + instanceId, + model, + instanceId === activeInstanceId ? activeOptions : undefined, + ), + ); + }} + /> + {activeInstanceEntry ? ( + {}} + modelOptions={activeOptions} + allowPromptInjectedEffort={false} + triggerVariant="outline" + triggerClassName="min-w-0 max-w-none shrink-0 text-foreground/90 hover:text-foreground" + onModelOptionsChange={(nextOptions) => { + setSweepModelSelection( + createModelSelection(activeInstanceId, activeModel, nextOptions), + ); + }} + /> + ) : null} + ) : ( server default )}