@@ -35,39 +35,48 @@ const CONTEXT_WINDOW = selectDescriptor(
3535
3636const CODEX = ProviderDriverKind . make ( "codex" ) ;
3737
38- function display ( descriptors : ReadonlyArray < ProviderOptionDescriptor > , fastModeEnabled : boolean ) {
38+ function display ( descriptors : ReadonlyArray < ProviderOptionDescriptor > ) {
3939 return buildTraitsTriggerDisplay ( {
4040 provider : CODEX ,
4141 descriptors,
4242 primarySelectDescriptorId : "reasoningEffort" ,
4343 ultrathinkPromptControlled : false ,
44- fastModeEnabled,
4544 } ) ;
4645}
4746
4847describe ( "buildTraitsTriggerDisplay" , ( ) => {
4948 it ( "omits fast mode from the label entirely when it is off" , ( ) => {
50- expect ( display ( [ EFFORT , fastModeDescriptor ( false ) , CONTEXT_WINDOW ] , false ) ) . toEqual ( {
49+ expect ( display ( [ EFFORT , fastModeDescriptor ( false ) , CONTEXT_WINDOW ] ) ) . toEqual ( {
5150 label : "High · 1M" ,
5251 showFastModeIcon : false ,
5352 } ) ;
5453 } ) ;
5554
5655 it ( "shows the bolt instead of a text label when fast mode is on" , ( ) => {
57- expect ( display ( [ EFFORT , fastModeDescriptor ( true ) , CONTEXT_WINDOW ] , true ) ) . toEqual ( {
56+ expect ( display ( [ EFFORT , fastModeDescriptor ( true ) , CONTEXT_WINDOW ] ) ) . toEqual ( {
5857 label : "High · 1M" ,
5958 showFastModeIcon : true ,
6059 } ) ;
6160 } ) ;
6261
63- it ( "omits Codex's default Standard tier beside reasoning " , ( ) => {
62+ it ( "renders Codex's Standard and Fast service tiers as fast mode " , ( ) => {
6463 const serviceTier = selectDescriptor (
6564 "serviceTier" ,
66- [ { id : "default" , label : "Standard" , isDefault : true } ] ,
65+ [
66+ { id : "default" , label : "Standard" , isDefault : true } ,
67+ { id : "priority" , label : "Fast" } ,
68+ ] ,
6769 "default" ,
6870 ) ;
6971
70- expect ( display ( [ EFFORT , serviceTier ] , false ) . label ) . toBe ( "High" ) ;
72+ expect ( display ( [ EFFORT , serviceTier ] ) ) . toEqual ( {
73+ label : "High" ,
74+ showFastModeIcon : false ,
75+ } ) ;
76+ expect ( display ( [ EFFORT , { ...serviceTier , currentValue : "priority" } ] ) ) . toEqual ( {
77+ label : "High" ,
78+ showFastModeIcon : true ,
79+ } ) ;
7180 } ) ;
7281
7382 it ( "keeps non-fastMode booleans as text labels" , ( ) => {
@@ -77,18 +86,18 @@ describe("buildTraitsTriggerDisplay", () => {
7786 type : "boolean" ,
7887 currentValue : true ,
7988 } ;
80- expect ( display ( [ EFFORT , thinking ] , false ) ) . toEqual ( {
89+ expect ( display ( [ EFFORT , thinking ] ) ) . toEqual ( {
8190 label : "High · Thinking On" ,
8291 showFastModeIcon : false ,
8392 } ) ;
8493 } ) ;
8594
8695 it ( "falls back to a text label when fast mode is the only trait" , ( ) => {
87- expect ( display ( [ fastModeDescriptor ( true ) ] , true ) ) . toEqual ( {
96+ expect ( display ( [ fastModeDescriptor ( true ) ] ) ) . toEqual ( {
8897 label : "Fast" ,
8998 showFastModeIcon : false ,
9099 } ) ;
91- expect ( display ( [ fastModeDescriptor ( false ) ] , false ) ) . toEqual ( {
100+ expect ( display ( [ fastModeDescriptor ( false ) ] ) ) . toEqual ( {
92101 label : "Normal" ,
93102 showFastModeIcon : false ,
94103 } ) ;
@@ -107,7 +116,7 @@ describe("buildTraitsTriggerDisplay", () => {
107116 { id : "high" , label : "High" } ,
108117 ] ,
109118 } ;
110- expect ( display ( [ unresolved ] , false ) ) . toEqual ( { label : "" , showFastModeIcon : false } ) ;
119+ expect ( display ( [ unresolved ] ) ) . toEqual ( { label : "" , showFastModeIcon : false } ) ;
111120 } ) ;
112121
113122 it ( "still renders the prompt-controlled ultrathink label alongside the bolt" , ( ) => {
@@ -117,7 +126,6 @@ describe("buildTraitsTriggerDisplay", () => {
117126 descriptors : [ EFFORT , fastModeDescriptor ( true ) ] ,
118127 primarySelectDescriptorId : "reasoningEffort" ,
119128 ultrathinkPromptControlled : true ,
120- fastModeEnabled : true ,
121129 } ) ,
122130 ) . toEqual ( { label : "Ultrathink" , showFastModeIcon : true } ) ;
123131 } ) ;
0 commit comments