@@ -153,7 +153,7 @@ suite("Roo Code Extension Test Suite", () => {
153
153
154
154
const timeout = 120000 // Increase timeout for CI
155
155
const interval = 2000 // Increase interval to reduce CPU usage
156
- const authTimeout = 300000 // 5 minutes timeout for auth provider
156
+ const apiConfigTimeout = 300000 // 5 minutes timeout for API configuration
157
157
158
158
console . log ( "Starting prompt and response test..." )
159
159
@@ -216,7 +216,7 @@ suite("Roo Code Extension Test Suite", () => {
216
216
// Set up message tracking with improved error handling
217
217
let webviewReady = false
218
218
let messagesReceived = false
219
- let authProviderRegistered = false
219
+ let apiConfigured = false
220
220
const originalPostMessage = await provider . postMessageToWebview . bind ( provider )
221
221
222
222
// @ts -ignore
@@ -230,9 +230,9 @@ suite("Roo Code Extension Test Suite", () => {
230
230
messagesReceived = true
231
231
console . log ( "Messages in state:" , message . state . codeMessages )
232
232
}
233
- if ( message . state ?. authProvider ) {
234
- authProviderRegistered = true
235
- console . log ( "Auth provider registered " )
233
+ if ( message . state ?. apiConfiguration ?. openRouterApiKey ) {
234
+ apiConfigured = true
235
+ console . log ( "API configuration completed " )
236
236
}
237
237
}
238
238
await originalPostMessage ( message )
@@ -242,22 +242,25 @@ suite("Roo Code Extension Test Suite", () => {
242
242
}
243
243
}
244
244
245
- // Wait for auth provider to register
246
- console . log ( "Waiting for auth provider registration ..." )
245
+ // Wait for API configuration
246
+ console . log ( "Waiting for API configuration ..." )
247
247
let startTime = Date . now ( )
248
- while ( Date . now ( ) - startTime < authTimeout ) {
249
- if ( authProviderRegistered ) {
250
- console . log ( "Auth provider successfully registered " )
248
+ while ( Date . now ( ) - startTime < apiConfigTimeout ) {
249
+ if ( apiConfigured ) {
250
+ console . log ( "API configuration successfully completed " )
251
251
break
252
252
}
253
- if ( Date . now ( ) - startTime > 60000 && ! authProviderRegistered ) {
254
- console . log ( "Auth provider status check at 1 minute mark:" , await provider . getState ( ) )
253
+ if ( Date . now ( ) - startTime > 60000 && ! apiConfigured ) {
254
+ const state = await provider . getState ( )
255
+ console . log ( "API configuration status check at 1 minute mark:" , state )
255
256
}
256
- await new Promise ( ( resolve ) => setTimeout ( resolve , interval ) )
257
+ await new Promise ( ( resolve ) => setTimeout ( resolve , 5000 ) ) // Longer interval for API config check
257
258
}
258
259
259
- if ( ! authProviderRegistered ) {
260
- throw new Error ( "Timeout waiting for auth provider registration" )
260
+ if ( ! apiConfigured ) {
261
+ const finalState = await provider . getState ( )
262
+ console . error ( "Final state before timeout:" , finalState )
263
+ throw new Error ( "Timeout waiting for API configuration" )
261
264
}
262
265
263
266
// Wait for webview to launch and receive initial state
0 commit comments