@@ -65,10 +65,8 @@ vitest.mock("../fetchers/modelCache", () => ({
6565 } ) ,
6666} ) )
6767
68- import type { Anthropic } from "@anthropic-ai/sdk"
6968import { poeDefaultModelId } from "@roo-code/types"
7069import { PoeHandler } from "../poe"
71- import type { ApiHandlerOptions } from "../../../shared/api"
7270
7371describe ( "PoeHandler" , ( ) => {
7472 const mockLanguageModel = { modelId : "test-model" }
@@ -160,65 +158,6 @@ describe("PoeHandler", () => {
160158 expect ( chunks ) . toContainEqual ( { type : "text" , text : "world!" } )
161159 expect ( chunks ) . toContainEqual ( expect . objectContaining ( { type : "usage" , inputTokens : 10 , outputTokens : 5 } ) )
162160 } )
163-
164- it ( "passes tools and tool_choice to streamText" , async ( ) => {
165- const handler = new PoeHandler ( { poeApiKey : "key" , apiModelId : "openai/gpt-4o" } )
166-
167- const fullStream = ( async function * ( ) {
168- yield { type : "text-delta" , text : "ok" }
169- } ) ( )
170-
171- mockStreamText . mockReturnValue ( {
172- fullStream,
173- usage : Promise . resolve ( { inputTokens : 1 , outputTokens : 1 } ) ,
174- } )
175-
176- const tools = [
177- {
178- type : "function" as const ,
179- function : {
180- name : "read_file" ,
181- description : "Read a file" ,
182- parameters : { type : "object" , properties : { path : { type : "string" } } , required : [ "path" ] } ,
183- } ,
184- } ,
185- ]
186-
187- const iterator = handler . createMessage ( "system" , [ { role : "user" as const , content : "read file" } ] , {
188- taskId : "test" ,
189- tools,
190- tool_choice : "auto" as any ,
191- } )
192-
193- // Consume stream
194- for await ( const _ of iterator ) {
195- /* drain */
196- }
197-
198- expect ( mockStreamText ) . toHaveBeenCalledWith (
199- expect . objectContaining ( {
200- model : mockLanguageModel ,
201- system : "system" ,
202- tools : expect . any ( Object ) ,
203- } ) ,
204- )
205- } )
206-
207- it ( "calls poe provider with correct model ID" , async ( ) => {
208- const handler = new PoeHandler ( { poeApiKey : "key" , apiModelId : "openai/gpt-4o" } )
209-
210- const fullStream = ( async function * ( ) { } ) ( )
211- mockStreamText . mockReturnValue ( {
212- fullStream,
213- usage : Promise . resolve ( { inputTokens : 0 , outputTokens : 0 } ) ,
214- } )
215-
216- for await ( const _ of handler . createMessage ( "sys" , [ { role : "user" as const , content : "hi" } ] ) ) {
217- /* drain */
218- }
219-
220- expect ( mockPoeProvider ) . toHaveBeenCalledWith ( "openai/gpt-4o" )
221- } )
222161 } )
223162
224163 describe ( "reasoning" , ( ) => {
0 commit comments