feat(web): model options for source control writer and review guide models (#18488)
Co-authored-by: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
2e24ec44db
commit
e688034b5f
1 file changed
+62
@@ -27,9 +27,11 @@ import {
|
||||
import {
|
||||
getCustomModelOptionsByInstance,
|
||||
resolveAppModelSelectionState,
|
||||
selectsPlanAgent,
|
||||
} from "../../modelSelection";
|
||||
import { EMPTY_SERVER_PROVIDERS } from "../../state/server";
|
||||
import { ProviderModelPicker } from "../chat/ProviderModelPicker";
|
||||
import { TraitsPicker } from "../chat/TraitsPicker";
|
||||
import { Select, SelectItem, SelectPopup, SelectTrigger, SelectValue } from "../ui/select";
|
||||
import { Switch } from "../ui/switch";
|
||||
import { Textarea } from "../ui/textarea";
|
||||
@@ -149,6 +151,9 @@ export function SourceControlWritingSettingsSection() {
|
||||
activeSelection.model,
|
||||
);
|
||||
const writerModelDisabledReason = useScopedModelDisabledReason(settings, instanceEntries);
|
||||
const writerInstanceEntry = instanceEntries.find(
|
||||
(entry) => entry.instanceId === activeSelection.instanceId,
|
||||
);
|
||||
const usesReviewGuideModel = settings.reviewGuideModelSelection !== null;
|
||||
const reviewGuideSelection = resolveAppModelSelectionState(
|
||||
{
|
||||
@@ -168,6 +173,9 @@ export function SourceControlWritingSettingsSection() {
|
||||
reviewGuideSelection.instanceId,
|
||||
reviewGuideSelection.model,
|
||||
);
|
||||
const reviewGuideInstanceEntry = instanceEntries.find(
|
||||
(entry) => entry.instanceId === reviewGuideSelection.instanceId,
|
||||
);
|
||||
|
||||
return (
|
||||
<SettingsSection id="source-control-text-generation" title="Text generation">
|
||||
@@ -381,6 +389,33 @@ export function SourceControlWritingSettingsSection() {
|
||||
}}
|
||||
/>
|
||||
) : null}
|
||||
{usesDedicatedModel &&
|
||||
canEnableDedicatedModel &&
|
||||
!mixedWriterModel &&
|
||||
writerInstanceEntry ? (
|
||||
<TraitsPicker
|
||||
provider={writerInstanceEntry.driverKind}
|
||||
models={writerInstanceEntry.models}
|
||||
model={activeSelection.model}
|
||||
prompt=""
|
||||
onPromptChange={() => {}}
|
||||
modelOptions={activeSelection.options ?? []}
|
||||
allowPromptInjectedEffort={false}
|
||||
planModeEnabled={
|
||||
settings.planModeEnabled || selectsPlanAgent(activeSelection.options)
|
||||
}
|
||||
triggerClassName={SETTINGS_PICKER_TRIGGER_CLASSNAME}
|
||||
onModelOptionsChange={(options) =>
|
||||
updateSettings({
|
||||
sourceControlWriterModelSelection: createModelSelection(
|
||||
activeSelection.instanceId,
|
||||
activeSelection.model,
|
||||
options,
|
||||
),
|
||||
})
|
||||
}
|
||||
/>
|
||||
) : null}
|
||||
<Switch
|
||||
checked={usesDedicatedModel}
|
||||
disabled={!usesDedicatedModel && !canEnableDedicatedModel}
|
||||
@@ -461,6 +496,33 @@ export function SourceControlWritingSettingsSection() {
|
||||
}}
|
||||
/>
|
||||
) : null}
|
||||
{usesReviewGuideModel &&
|
||||
canEnableDedicatedModel &&
|
||||
!mixedReviewGuideModel &&
|
||||
reviewGuideInstanceEntry ? (
|
||||
<TraitsPicker
|
||||
provider={reviewGuideInstanceEntry.driverKind}
|
||||
models={reviewGuideInstanceEntry.models}
|
||||
model={reviewGuideSelection.model}
|
||||
prompt=""
|
||||
onPromptChange={() => {}}
|
||||
modelOptions={reviewGuideSelection.options ?? []}
|
||||
allowPromptInjectedEffort={false}
|
||||
planModeEnabled={
|
||||
settings.planModeEnabled || selectsPlanAgent(reviewGuideSelection.options)
|
||||
}
|
||||
triggerClassName={SETTINGS_PICKER_TRIGGER_CLASSNAME}
|
||||
onModelOptionsChange={(options) =>
|
||||
updateSettings({
|
||||
reviewGuideModelSelection: createModelSelection(
|
||||
reviewGuideSelection.instanceId,
|
||||
reviewGuideSelection.model,
|
||||
options,
|
||||
),
|
||||
})
|
||||
}
|
||||
/>
|
||||
) : null}
|
||||
<Switch
|
||||
mixed={mixedReviewGuideModel}
|
||||
checked={mixedReviewGuideModel ? false : usesReviewGuideModel}
|
||||
|
||||
Reference in new issue
Block a user