| ... | @@ -27,9 +27,11 @@ import { | ... | @@ -27,9 +27,11 @@ import { |
| 27 | import { | 27 | import { |
| 28 | getCustomModelOptionsByInstance, | 28 | getCustomModelOptionsByInstance, |
| 29 | resolveAppModelSelectionState, | 29 | resolveAppModelSelectionState, |
| | 30 | selectsPlanAgent, |
| 30 | } from "../../modelSelection"; | 31 | } from "../../modelSelection"; |
| 31 | import { EMPTY_SERVER_PROVIDERS } from "../../state/server"; | 32 | import { EMPTY_SERVER_PROVIDERS } from "../../state/server"; |
| 32 | import { ProviderModelPicker } from "../chat/ProviderModelPicker"; | 33 | import { ProviderModelPicker } from "../chat/ProviderModelPicker"; |
| | 34 | import { TraitsPicker } from "../chat/TraitsPicker"; |
| 33 | import { Select, SelectItem, SelectPopup, SelectTrigger, SelectValue } from "../ui/select"; | 35 | import { Select, SelectItem, SelectPopup, SelectTrigger, SelectValue } from "../ui/select"; |
| 34 | import { Switch } from "../ui/switch"; | 36 | import { Switch } from "../ui/switch"; |
| 35 | import { Textarea } from "../ui/textarea"; | 37 | import { Textarea } from "../ui/textarea"; |
| ... | @@ -149,6 +151,9 @@ export function SourceControlWritingSettingsSection() { | ... | @@ -149,6 +151,9 @@ export function SourceControlWritingSettingsSection() { |
| 149 | activeSelection.model, | 151 | activeSelection.model, |
| 150 | ); | 152 | ); |
| 151 | const writerModelDisabledReason = useScopedModelDisabledReason(settings, instanceEntries); | 153 | const writerModelDisabledReason = useScopedModelDisabledReason(settings, instanceEntries); |
| | 154 | const writerInstanceEntry = instanceEntries.find( |
| | 155 | (entry) => entry.instanceId === activeSelection.instanceId, |
| | 156 | ); |
| 152 | const usesReviewGuideModel = settings.reviewGuideModelSelection !== null; | 157 | const usesReviewGuideModel = settings.reviewGuideModelSelection !== null; |
| 153 | const reviewGuideSelection = resolveAppModelSelectionState( | 158 | const reviewGuideSelection = resolveAppModelSelectionState( |
| 154 | { | 159 | { |
| ... | @@ -168,6 +173,9 @@ export function SourceControlWritingSettingsSection() { | ... | @@ -168,6 +173,9 @@ export function SourceControlWritingSettingsSection() { |
| 168 | reviewGuideSelection.instanceId, | 173 | reviewGuideSelection.instanceId, |
| 169 | reviewGuideSelection.model, | 174 | reviewGuideSelection.model, |
| 170 | ); | 175 | ); |
| | 176 | const reviewGuideInstanceEntry = instanceEntries.find( |
| | 177 | (entry) => entry.instanceId === reviewGuideSelection.instanceId, |
| | 178 | ); |
| 171 | | 179 | |
| 172 | return ( | 180 | return ( |
| 173 | <SettingsSection id="source-control-text-generation" title="Text generation"> | 181 | <SettingsSection id="source-control-text-generation" title="Text generation"> |
| ... | @@ -381,6 +389,33 @@ export function SourceControlWritingSettingsSection() { | ... | @@ -381,6 +389,33 @@ export function SourceControlWritingSettingsSection() { |
| 381 | }} | 389 | }} |
| 382 | /> | 390 | /> |
| 383 | ) : null} | 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 | <Switch | 419 | <Switch |
| 385 | checked={usesDedicatedModel} | 420 | checked={usesDedicatedModel} |
| 386 | disabled={!usesDedicatedModel && !canEnableDedicatedModel} | 421 | disabled={!usesDedicatedModel && !canEnableDedicatedModel} |
| ... | @@ -461,6 +496,33 @@ export function SourceControlWritingSettingsSection() { | ... | @@ -461,6 +496,33 @@ export function SourceControlWritingSettingsSection() { |
| 461 | }} | 496 | }} |
| 462 | /> | 497 | /> |
| 463 | ) : null} | 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 | <Switch | 526 | <Switch |
| 465 | mixed={mixedReviewGuideModel} | 527 | mixed={mixedReviewGuideModel} |
| 466 | checked={mixedReviewGuideModel ? false : usesReviewGuideModel} | 528 | checked={mixedReviewGuideModel ? false : usesReviewGuideModel} |