| ... | @@ -1,10 +1,10 @@ | ... | @@ -1,10 +1,10 @@ |
| 1 | import { describe, expect, it } from "vite-plus/test"; | 1 | import { describe, expect, it } from "vite-plus/test"; |
| 2 | import type { ProviderOptionDescriptor } from "@t3tools/contracts"; | 2 | import { ProviderDriverKind, type ProviderOptionDescriptor } from "@t3tools/contracts"; |
| 3 | import { buildTraitsTriggerDisplay } from "./TraitsPicker"; | 3 | import { buildTraitsTriggerDisplay } from "./TraitsPicker"; |
| 4 | | 4 | |
| 5 | function selectDescriptor( | 5 | function selectDescriptor( |
| 6 | id: string, | 6 | id: string, |
| 7 | options: ReadonlyArray<{ id: string; label: string }>, | 7 | options: ReadonlyArray<{ id: string; label: string; isDefault?: boolean }>, |
| 8 | currentValue: string, | 8 | currentValue: string, |
| 9 | ): Extract<ProviderOptionDescriptor, { type: "select" }> { | 9 | ): Extract<ProviderOptionDescriptor, { type: "select" }> { |
| 10 | return { id, label: id, type: "select", options: [...options], currentValue }; | 10 | return { id, label: id, type: "select", options: [...options], currentValue }; |
| ... | @@ -17,7 +17,7 @@ function fastModeDescriptor( | ... | @@ -17,7 +17,7 @@ function fastModeDescriptor( |
| 17 | } | 17 | } |
| 18 | | 18 | |
| 19 | const EFFORT = selectDescriptor( | 19 | const EFFORT = selectDescriptor( |
| 20 | "effort", | 20 | "reasoningEffort", |
| 21 | [ | 21 | [ |
| 22 | { id: "high", label: "High" }, | 22 | { id: "high", label: "High" }, |
| 23 | { id: "max", label: "Max" }, | 23 | { id: "max", label: "Max" }, |
| ... | @@ -33,10 +33,13 @@ const CONTEXT_WINDOW = selectDescriptor( | ... | @@ -33,10 +33,13 @@ const CONTEXT_WINDOW = selectDescriptor( |
| 33 | "1m", | 33 | "1m", |
| 34 | ); | 34 | ); |
| 35 | | 35 | |
| | 36 | const CODEX = ProviderDriverKind.make("codex"); |
| | 37 | |
| 36 | function display(descriptors: ReadonlyArray<ProviderOptionDescriptor>, fastModeEnabled: boolean) { | 38 | function display(descriptors: ReadonlyArray<ProviderOptionDescriptor>, fastModeEnabled: boolean) { |
| 37 | return buildTraitsTriggerDisplay({ | 39 | return buildTraitsTriggerDisplay({ |
| | 40 | provider: CODEX, |
| 38 | descriptors, | 41 | descriptors, |
| 39 | primarySelectDescriptorId: "effort", | 42 | primarySelectDescriptorId: "reasoningEffort", |
| 40 | ultrathinkPromptControlled: false, | 43 | ultrathinkPromptControlled: false, |
| 41 | fastModeEnabled, | 44 | fastModeEnabled, |
| 42 | }); | 45 | }); |
| ... | @@ -57,6 +60,16 @@ describe("buildTraitsTriggerDisplay", () => { | ... | @@ -57,6 +60,16 @@ describe("buildTraitsTriggerDisplay", () => { |
| 57 | }); | 60 | }); |
| 58 | }); | 61 | }); |
| 59 | | 62 | |
| | 63 | it("omits Codex's default Standard tier beside reasoning", () => { |
| | 64 | const serviceTier = selectDescriptor( |
| | 65 | "serviceTier", |
| | 66 | [{ id: "default", label: "Standard", isDefault: true }], |
| | 67 | "default", |
| | 68 | ); |
| | 69 | |
| | 70 | expect(display([EFFORT, serviceTier], false).label).toBe("High"); |
| | 71 | }); |
| | 72 | |
| 60 | it("keeps non-fastMode booleans as text labels", () => { | 73 | it("keeps non-fastMode booleans as text labels", () => { |
| 61 | const thinking: Extract<ProviderOptionDescriptor, { type: "boolean" }> = { | 74 | const thinking: Extract<ProviderOptionDescriptor, { type: "boolean" }> = { |
| 62 | id: "thinking", | 75 | id: "thinking", |
| ... | @@ -100,8 +113,9 @@ describe("buildTraitsTriggerDisplay", () => { | ... | @@ -100,8 +113,9 @@ describe("buildTraitsTriggerDisplay", () => { |
| 100 | it("still renders the prompt-controlled ultrathink label alongside the bolt", () => { | 113 | it("still renders the prompt-controlled ultrathink label alongside the bolt", () => { |
| 101 | expect( | 114 | expect( |
| 102 | buildTraitsTriggerDisplay({ | 115 | buildTraitsTriggerDisplay({ |
| | 116 | provider: CODEX, |
| 103 | descriptors: [EFFORT, fastModeDescriptor(true)], | 117 | descriptors: [EFFORT, fastModeDescriptor(true)], |
| 104 | primarySelectDescriptorId: "effort", | 118 | primarySelectDescriptorId: "reasoningEffort", |
| 105 | ultrathinkPromptControlled: true, | 119 | ultrathinkPromptControlled: true, |
| 106 | fastModeEnabled: true, | 120 | fastModeEnabled: true, |
| 107 | }), | 121 | }), |