@@ -139,24 +139,18 @@ describe("resolveToolProtocol", () => {
139139 } )
140140 } )
141141
142- describe ( "Precedence Level 3: Native Fallback" , ( ) => {
143- it ( "should use Native fallback when no model default is specified and model supports native " , ( ) => {
142+ describe ( "Precedence Level 3: XML Fallback" , ( ) => {
143+ it ( "should use XML fallback when no model default is specified" , ( ) => {
144144 const settings : ProviderSettings = {
145145 apiProvider : "anthropic" ,
146146 }
147- const modelInfo : ModelInfo = {
148- maxTokens : 4096 ,
149- contextWindow : 128000 ,
150- supportsPromptCache : false ,
151- supportsNativeTools : true ,
152- }
153- const result = resolveToolProtocol ( settings , modelInfo )
154- expect ( result ) . toBe ( TOOL_PROTOCOL . NATIVE ) // Native fallback
147+ const result = resolveToolProtocol ( settings , undefined )
148+ expect ( result ) . toBe ( TOOL_PROTOCOL . XML ) // XML fallback
155149 } )
156150 } )
157151
158152 describe ( "Complete Precedence Chain" , ( ) => {
159- it ( "should respect full precedence: Profile > Model Default > Native Fallback" , ( ) => {
153+ it ( "should respect full precedence: Profile > Model Default > XML Fallback" , ( ) => {
160154 // Set up a scenario with all levels defined
161155 const settings : ProviderSettings = {
162156 toolProtocol : "native" , // Level 1: User profile setting
@@ -192,7 +186,7 @@ describe("resolveToolProtocol", () => {
192186 expect ( result ) . toBe ( TOOL_PROTOCOL . XML ) // Model default wins
193187 } )
194188
195- it ( "should skip to Native fallback when profile and model default are undefined" , ( ) => {
189+ it ( "should skip to XML fallback when profile and model default are undefined" , ( ) => {
196190 const settings : ProviderSettings = {
197191 apiProvider : "openai-native" ,
198192 }
@@ -205,7 +199,7 @@ describe("resolveToolProtocol", () => {
205199 }
206200
207201 const result = resolveToolProtocol ( settings , modelInfo )
208- expect ( result ) . toBe ( TOOL_PROTOCOL . NATIVE ) // Native fallback
202+ expect ( result ) . toBe ( TOOL_PROTOCOL . XML ) // XML fallback
209203 } )
210204
211205 it ( "should skip to XML fallback when model info is unavailable" , ( ) => {
@@ -214,23 +208,23 @@ describe("resolveToolProtocol", () => {
214208 }
215209
216210 const result = resolveToolProtocol ( settings , undefined )
217- expect ( result ) . toBe ( TOOL_PROTOCOL . XML ) // XML fallback (no model info means no native support)
211+ expect ( result ) . toBe ( TOOL_PROTOCOL . XML ) // XML fallback
218212 } )
219213 } )
220214
221215 describe ( "Edge Cases" , ( ) => {
222216 it ( "should handle missing provider name gracefully" , ( ) => {
223217 const settings : ProviderSettings = { }
224218 const result = resolveToolProtocol ( settings )
225- expect ( result ) . toBe ( TOOL_PROTOCOL . XML ) // Falls back to XML (no model info)
219+ expect ( result ) . toBe ( TOOL_PROTOCOL . XML ) // Falls back to global
226220 } )
227221
228222 it ( "should handle undefined model info gracefully" , ( ) => {
229223 const settings : ProviderSettings = {
230224 apiProvider : "openai-native" ,
231225 }
232226 const result = resolveToolProtocol ( settings , undefined )
233- expect ( result ) . toBe ( TOOL_PROTOCOL . XML ) // XML fallback (no model info)
227+ expect ( result ) . toBe ( TOOL_PROTOCOL . XML ) // XML fallback
234228 } )
235229
236230 it ( "should fall back to XML when model doesn't support native" , ( ) => {
@@ -249,7 +243,7 @@ describe("resolveToolProtocol", () => {
249243 } )
250244
251245 describe ( "Real-world Scenarios" , ( ) => {
252- it ( "should use Native fallback for models without defaultToolProtocol" , ( ) => {
246+ it ( "should use XML fallback for models without defaultToolProtocol" , ( ) => {
253247 const settings : ProviderSettings = {
254248 apiProvider : "openai-native" ,
255249 }
@@ -260,7 +254,7 @@ describe("resolveToolProtocol", () => {
260254 supportsNativeTools : true ,
261255 }
262256 const result = resolveToolProtocol ( settings , modelInfo )
263- expect ( result ) . toBe ( TOOL_PROTOCOL . NATIVE ) // Native fallback
257+ expect ( result ) . toBe ( TOOL_PROTOCOL . XML ) // XML fallback
264258 } )
265259
266260 it ( "should use XML for Claude models with Anthropic provider" , ( ) => {
0 commit comments