@@ -175,4 +175,61 @@ describe("CerebrasHandler", () => {
175175 // Test fallback token estimation logic
176176 } )
177177 } )
178+
179+ describe ( "computer use support" , ( ) => {
180+ it ( "should return supportsComputerUse true for qwen-3-coder-480b-free model" , ( ) => {
181+ const testModelId : CerebrasModelId = "qwen-3-coder-480b-free"
182+ const handlerWithModel = new CerebrasHandler ( {
183+ cerebrasApiKey : "test-api-key" ,
184+ apiModelId : testModelId ,
185+ } )
186+ const { id, info } = handlerWithModel . getModel ( )
187+ // The model ID is routed from qwen-3-coder-480b-free to qwen-3-coder-480b
188+ expect ( id ) . toBe ( "qwen-3-coder-480b" )
189+ // But the info should be from the original model (qwen-3-coder-480b-free)
190+ expect ( "supportsComputerUse" in info && info . supportsComputerUse ) . toBe ( true )
191+ expect ( info . maxTokens ) . toBe ( 40000 )
192+ expect ( info . contextWindow ) . toBe ( 64000 )
193+ expect ( info . inputPrice ) . toBe ( 0 )
194+ expect ( info . outputPrice ) . toBe ( 0 )
195+ expect ( info . description ) . toContain ( "SOTA coding model" )
196+ expect ( info . description ) . toContain ( "$0 free tier" )
197+ } )
198+
199+ it ( "should return supportsComputerUse true for qwen-3-coder-480b model" , ( ) => {
200+ const testModelId : CerebrasModelId = "qwen-3-coder-480b"
201+ const handlerWithModel = new CerebrasHandler ( {
202+ cerebrasApiKey : "test-api-key" ,
203+ apiModelId : testModelId ,
204+ } )
205+ const { id, info } = handlerWithModel . getModel ( )
206+ expect ( id ) . toBe ( testModelId )
207+ expect ( "supportsComputerUse" in info && info . supportsComputerUse ) . toBe ( true )
208+ expect ( info . maxTokens ) . toBe ( 40000 )
209+ expect ( info . contextWindow ) . toBe ( 128000 )
210+ expect ( info . inputPrice ) . toBe ( 0 )
211+ expect ( info . outputPrice ) . toBe ( 0 )
212+ expect ( info . description ) . toContain ( "SOTA coding model" )
213+ } )
214+
215+ it ( "should not have supportsComputerUse for other Cerebras models" , ( ) => {
216+ const otherModels : CerebrasModelId [ ] = [
217+ "llama-3.3-70b" ,
218+ "qwen-3-235b-a22b-instruct-2507" ,
219+ "qwen-3-32b" ,
220+ "qwen-3-235b-a22b-thinking-2507" ,
221+ ]
222+
223+ otherModels . forEach ( ( modelId ) => {
224+ const handlerWithModel = new CerebrasHandler ( {
225+ cerebrasApiKey : "test-api-key" ,
226+ apiModelId : modelId ,
227+ } )
228+ const { id, info } = handlerWithModel . getModel ( )
229+ expect ( id ) . toBe ( modelId )
230+ // Should be undefined or false
231+ expect ( "supportsComputerUse" in info ? info . supportsComputerUse : undefined ) . toBeFalsy ( )
232+ } )
233+ } )
234+ } )
178235} )
0 commit comments