Add traits picker to the review modal and stop wiping model options

The modal exposed only the model, so reasoning effort, thinking, and
fast mode weren't reachable — and worse, picking a model called
createModelSelection without options, silently clearing whatever traits
the sticky selection carried.

The modal now renders the composer's TraitsPicker beside the model
picker, and a model switch preserves the current options when the
instance is unchanged (a different instance's options aren't
transferable, so those start clean). No server change needed: the
provider CLIs already derive effort/thinking/fastMode/ultracode from
modelSelection.options.

Co-Authored-By: Claude Fable 5 <[email protected]>
This commit is contained in:
Theo BrowneandClaude Fable 5 committed 2026-07-26 22:51:05 -07:00
1 parent a8c3047710
commit 8c9dbfc01a
1 file changed
+47 -13
@@ -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 } = {
))}
</div>
) : null}
<div className="flex items-center gap-2 pt-0.5">
<div className="flex flex-wrap items-center gap-2 pt-0.5">
<span className="shrink-0">Review with</span>
{activeInstanceId !== null ? (
<ProviderModelPicker
activeInstanceId={activeInstanceId}
model={activeModel}
lockedProvider={null}
instanceEntries={instanceEntries}
modelOptionsByInstance={modelOptionsByInstance}
triggerVariant="outline"
triggerClassName="min-w-0 max-w-none shrink-0 text-foreground/90 hover:text-foreground"
onInstanceModelChange={(instanceId, model) => {
setSweepModelSelection(createModelSelection(instanceId, model));
}}
/>
<>
<ProviderModelPicker
activeInstanceId={activeInstanceId}
model={activeModel}
lockedProvider={null}
instanceEntries={instanceEntries}
modelOptionsByInstance={modelOptionsByInstance}
triggerVariant="outline"
triggerClassName="min-w-0 max-w-none shrink-0 text-foreground/90 hover:text-foreground"
onInstanceModelChange={(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 ? (
<TraitsPicker
provider={activeInstanceEntry.driverKind}
models={activeInstanceEntry.models}
model={activeModel}
prompt=""
onPromptChange={() => {}}
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}
</>
) : (
<span className="text-foreground">server default</span>
)}