| ... | ... | @@ -27,9 +27,11 @@ import { |
| 27 | 27 | import { |
| 28 | 28 | getCustomModelOptionsByInstance, |
| 29 | 29 | resolveAppModelSelectionState, |
| 30 | selectsPlanAgent, |
| 30 | 31 | } from "../../modelSelection"; |
| 31 | 32 | import { EMPTY_SERVER_PROVIDERS } from "../../state/server"; |
| 32 | 33 | import { ProviderModelPicker } from "../chat/ProviderModelPicker"; |
| 34 | import { TraitsPicker } from "../chat/TraitsPicker"; |
| 33 | 35 | import { Select, SelectItem, SelectPopup, SelectTrigger, SelectValue } from "../ui/select"; |
| 34 | 36 | import { Switch } from "../ui/switch"; |
| 35 | 37 | import { Textarea } from "../ui/textarea"; |
| ... | ... | @@ -149,6 +151,9 @@ export function SourceControlWritingSettingsSection() { |
| 149 | 151 | activeSelection.model, |
| 150 | 152 | ); |
| 151 | 153 | const writerModelDisabledReason = useScopedModelDisabledReason(settings, instanceEntries); |
| 154 | const writerInstanceEntry = instanceEntries.find( |
| 155 | (entry) => entry.instanceId === activeSelection.instanceId, |
| 156 | ); |
| 152 | 157 | const usesReviewGuideModel = settings.reviewGuideModelSelection !== null; |
| 153 | 158 | const reviewGuideSelection = resolveAppModelSelectionState( |
| 154 | 159 | { |
| ... | ... | @@ -168,6 +173,9 @@ export function SourceControlWritingSettingsSection() { |
| 168 | 173 | reviewGuideSelection.instanceId, |
| 169 | 174 | reviewGuideSelection.model, |
| 170 | 175 | ); |
| 176 | const reviewGuideInstanceEntry = instanceEntries.find( |
| 177 | (entry) => entry.instanceId === reviewGuideSelection.instanceId, |
| 178 | ); |
| 171 | 179 | |
| 172 | 180 | return ( |
| 173 | 181 | <SettingsSection id="source-control-text-generation" title="Text generation"> |
| ... | ... | @@ -381,6 +389,33 @@ export function SourceControlWritingSettingsSection() { |
| 381 | 389 | }} |
| 382 | 390 | /> |
| 383 | 391 | ) : null} |
| 392 | {usesDedicatedModel && |
| 393 | canEnableDedicatedModel && |
| 394 | !mixedWriterModel && |
| 395 | writerInstanceEntry ? ( |
| 396 | <TraitsPicker |
| 397 | provider={writerInstanceEntry.driverKind} |
| 398 | models={writerInstanceEntry.models} |
| 399 | model={activeSelection.model} |
| 400 | prompt="" |
| 401 | onPromptChange={() => {}} |
| 402 | modelOptions={activeSelection.options ?? []} |
| 403 | allowPromptInjectedEffort={false} |
| 404 | planModeEnabled={ |
| 405 | settings.planModeEnabled || selectsPlanAgent(activeSelection.options) |
| 406 | } |
| 407 | triggerClassName={SETTINGS_PICKER_TRIGGER_CLASSNAME} |
| 408 | onModelOptionsChange={(options) => |
| 409 | updateSettings({ |
| 410 | sourceControlWriterModelSelection: createModelSelection( |
| 411 | activeSelection.instanceId, |
| 412 | activeSelection.model, |
| 413 | options, |
| 414 | ), |
| 415 | }) |
| 416 | } |
| 417 | /> |
| 418 | ) : null} |
| 384 | 419 | <Switch |
| 385 | 420 | checked={usesDedicatedModel} |
| 386 | 421 | disabled={!usesDedicatedModel && !canEnableDedicatedModel} |
| ... | ... | @@ -461,6 +496,33 @@ export function SourceControlWritingSettingsSection() { |
| 461 | 496 | }} |
| 462 | 497 | /> |
| 463 | 498 | ) : null} |
| 499 | {usesReviewGuideModel && |
| 500 | canEnableDedicatedModel && |
| 501 | !mixedReviewGuideModel && |
| 502 | reviewGuideInstanceEntry ? ( |
| 503 | <TraitsPicker |
| 504 | provider={reviewGuideInstanceEntry.driverKind} |
| 505 | models={reviewGuideInstanceEntry.models} |
| 506 | model={reviewGuideSelection.model} |
| 507 | prompt="" |
| 508 | onPromptChange={() => {}} |
| 509 | modelOptions={reviewGuideSelection.options ?? []} |
| 510 | allowPromptInjectedEffort={false} |
| 511 | planModeEnabled={ |
| 512 | settings.planModeEnabled || selectsPlanAgent(reviewGuideSelection.options) |
| 513 | } |
| 514 | triggerClassName={SETTINGS_PICKER_TRIGGER_CLASSNAME} |
| 515 | onModelOptionsChange={(options) => |
| 516 | updateSettings({ |
| 517 | reviewGuideModelSelection: createModelSelection( |
| 518 | reviewGuideSelection.instanceId, |
| 519 | reviewGuideSelection.model, |
| 520 | options, |
| 521 | ), |
| 522 | }) |
| 523 | } |
| 524 | /> |
| 525 | ) : null} |
| 464 | 526 | <Switch |
| 465 | 527 | mixed={mixedReviewGuideModel} |
| 466 | 528 | checked={mixedReviewGuideModel ? false : usesReviewGuideModel} |