feat: add custom model names and option descriptors #9807
Mergedjuliusmarmingemerged 9 commits into
main fromrefs/pull/9807/headmerged by juliusmarminge View on GitHubgithub-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:XXL
- apps/web/src/components/settings/CustomModelEditor.tsx line 132OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -0,0 +112,21 @@112+ updateDescriptor(descriptor.key, { id: "" });113+ return;114+ }115+ const preset = presets.find((candidate) => candidate.id === value);116+ if (!preset) return;117+ updateDescriptor(descriptor.key, {118+ id: preset.id,119+ label: preset.label,120+ type: preset.type,121+ choices: (preset.choices ?? []).map(choiceFromPreset),122+ });123+ };124+125+ const handleStartFrom = (slug: string | null) => {126+ if (slug === null || slug === START_FROM_NONE) return;127+ const model = startFromCandidates.find((candidate) => candidate.slug === slug);128+ if (!model) return;129+ setError(null);130+ setDraft((current) => ({131+ ...current,132+ descriptors: descriptorsFromCapabilities(model.capabilities),
- docs/user/composer.md line 35OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -30,3 +30,6 @@3030 messages survive app restarts. Signing out of T3 Connect keeps that work on your3131 device until you sign back into the same account.323233+## Custom models34+35+Each provider's **Models** section in Settings accepts model slugs the provider does not list on its
- apps/web/src/components/settings/customModelEditor.logic.ts line 163Resolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -0,0 +141,21 @@141+ */142+export function descriptorToEditor(descriptor: ProviderOptionDescriptor): EditorDescriptor {143+ const promptInjected = new Set(144+ descriptor.type === "select" ? (descriptor.promptInjectedValues ?? []) : [],145+ );146+ const choices =147+ descriptor.type === "select"148+ ? descriptor.options.filter((option) => !promptInjected.has(option.id))149+ : [];150+ const defaultChoice =151+ choices.find((option) => option.id === descriptor.currentValue) ??152+ choices.find((option) => option.isDefault);153+ return {154+ key: newEditorKey(),155+ type: descriptor.type,156+ id: descriptor.id,157+ label: descriptor.label,158+ ...(descriptor.type === "boolean" && descriptor.currentValue !== undefined159+ ? { currentBooleanValue: descriptor.currentValue }160+ : {}),161+ choices: choices.map((option) => ({
- apps/web/src/components/settings/customModelEditor.logic.ts line 87Resolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -0,0 +67,21 @@67+ ],68+ [ProviderDriverKind.make("claudeAgent")]: [69+ {70+ id: "effort",71+ label: "Reasoning",72+ type: "select",73+ choices: [74+ { id: "low", label: "Low" },75+ { id: "medium", label: "Medium" },76+ { id: "high", label: "High", isDefault: true },77+ { id: "xhigh", label: "Extra High" },78+ { id: "max", label: "Max" },79+ ],80+ },81+ { id: "fastMode", label: "Fast Mode", type: "boolean" },82+ { id: "thinking", label: "Thinking", type: "boolean" },83+ ],84+ [ProviderDriverKind.make("cursor")]: [85+ { id: "reasoning", label: "Reasoning", type: "select", choices: EFFORT_CHOICES },86+ { id: "fastMode", label: "Fast Mode", type: "boolean" },87+ { id: "thinking", label: "Thinking", type: "boolean" },
juliusmarminge merged this5a43324
juliusmarminge closed this
Sign in to join this conversation.





macroscopeapp[bot](GitHub profile, opens in a new tab) reviewed