@@ -116,7 +116,7 @@ function registryDefaultForModel(
116116 modelId : string ,
117117 inbound : InboundWire ,
118118 authMode : ProviderAuthKind | undefined ,
119- ) : string | undefined {
119+ ) : { adapter : string ; forwardCallerServiceTier ?: boolean } | undefined {
120120 const normalizedModelId = modelId . trim ( ) . toLowerCase ( ) ;
121121 if ( ! Object . hasOwn ( defaults , normalizedModelId ) ) return undefined ;
122122 const declared = defaults [ normalizedModelId ] ;
@@ -128,14 +128,20 @@ function registryDefaultForModel(
128128 }
129129 }
130130 const wire = typeof declared === "string" ? declared : declared . wire ;
131- return MODEL_ADAPTER_OVERRIDE_ALLOWED . has ( wire ) ? wire : undefined ;
131+ if ( ! MODEL_ADAPTER_OVERRIDE_ALLOWED . has ( wire ) ) return undefined ;
132+ return {
133+ adapter : wire ,
134+ ...( typeof declared !== "string" && declared . forwardCallerServiceTier !== undefined
135+ ? { forwardCallerServiceTier : declared . forwardCallerServiceTier }
136+ : { } ) ,
137+ } ;
132138}
133139
134140function resolvePolicyAdapter (
135141 authority : FastPolicyAuthority ,
136142 modelId : string ,
137143 inbound : InboundWire ,
138- ) : { adapter : string ; hardPinned : boolean } {
144+ ) : { adapter : string ; hardPinned : boolean ; forwardCallerServiceTier ?: boolean } {
139145 // Hard pins and configured overrides deliberately use the same exact-key semantics as
140146 // resolveWireProtocolOverride(). Registry defaults alone normalize ids at their boundary.
141147 const hardPin = Object . hasOwn ( authority . hardPins , modelId )
@@ -156,7 +162,15 @@ function resolvePolicyAdapter(
156162 inbound ,
157163 authority . providerAuthMode ,
158164 ) ;
159- if ( registryDefault !== undefined ) return { adapter : registryDefault , hardPinned : false } ;
165+ if ( registryDefault !== undefined ) {
166+ return {
167+ adapter : registryDefault . adapter ,
168+ hardPinned : false ,
169+ ...( registryDefault . forwardCallerServiceTier !== undefined
170+ ? { forwardCallerServiceTier : registryDefault . forwardCallerServiceTier }
171+ : { } ) ,
172+ } ;
173+ }
160174 }
161175 }
162176 return { adapter : authority . providerAdapter , hardPinned : false } ;
@@ -167,7 +181,11 @@ export function resolveFastPolicy(
167181 modelId : string ,
168182 inbound : InboundWire = "responses" ,
169183) : ResolvedFastPolicy {
170- const { adapter, hardPinned } = resolvePolicyAdapter ( authority , modelId , inbound ) ;
184+ const { adapter, hardPinned, forwardCallerServiceTier } = resolvePolicyAdapter (
185+ authority ,
186+ modelId ,
187+ inbound ,
188+ ) ;
171189 const exactCapability = exactModelValue ( authority . capability . models , modelId ) ;
172190 const capability = authority . capability . provider === false
173191 ? false
@@ -185,6 +203,7 @@ export function resolveFastPolicy(
185203 // tier still needs the final wire's forwarding permission.
186204 const forwardCallerTier = capability !== false
187205 && callerWireAvailable
206+ && forwardCallerServiceTier !== false
188207 && ( adapter !== "openai-chat" || authority . capability . chatServiceTier === true ) ;
189208
190209 let eligibility : ResolvedFastPolicy [ "eligibility" ] ;
0 commit comments