@@ -225,6 +225,7 @@ export class Container {
225225 if ( ! process . env . ROVODEV_BBY ) {
226226 // refresh Rovo Dev when auth sites change
227227 this . _siteManager . onDidSitesAvailableChange ( async ( ) => {
228+ console . log ( '[RovoDev Debug] Sites available changed, triggering refreshRovoDev' ) ;
228229 await this . updateFeatureFlagTenantId ( ) ;
229230 await this . refreshRovoDev ( context ) ;
230231 } ) ;
@@ -233,6 +234,9 @@ export class Container {
233234 context . subscriptions . push (
234235 configuration . onDidChange ( async ( e ) => {
235236 if ( configuration . changed ( e , 'jira.enabled' ) || configuration . changed ( e , 'rovodev.enabled' ) ) {
237+ console . log (
238+ '[RovoDev Debug] Config changed (jira.enabled or rovodev.enabled), triggering refreshRovoDev' ,
239+ ) ;
236240 await this . refreshRovoDev ( context ) ;
237241 }
238242 } , this ) ,
@@ -250,7 +254,9 @@ export class Container {
250254
251255 this . _onboardingProvider = new OnboardingProvider ( ) ;
252256
257+ console . log ( '[RovoDev Debug] Container initialization: calling refreshRovoDev' ) ;
253258 await this . refreshRovoDev ( context ) ;
259+ console . log ( '[RovoDev Debug] Container initialization: complete' ) ;
254260 }
255261
256262 private static async initializeFeatureFlagClient ( ) {
@@ -301,24 +307,42 @@ export class Container {
301307 private static async refreshRovoDev ( context : ExtensionContext ) {
302308 const shouldEnableRovoDev = ( this . config . rovodev . enabled && this . config . jira . enabled ) || this . isBoysenberryMode ;
303309
310+ console . log ( '[RovoDev Debug] refreshRovoDev called:' , {
311+ shouldEnableRovoDev,
312+ 'config.rovodev.enabled' : this . config . rovodev . enabled ,
313+ 'config.jira.enabled' : this . config . jira . enabled ,
314+ isBoysenberryMode : this . isBoysenberryMode ,
315+ currentlyEnabled : this . _isRovoDevEnabled ,
316+ hasDisposable : ! ! this . _rovodevDisposable ,
317+ } ) ;
318+
304319 if ( shouldEnableRovoDev ) {
320+ console . log ( '[RovoDev Debug] Calling enableRovoDev' ) ;
305321 await this . enableRovoDev ( context ) ;
306322 } else {
323+ console . log ( '[RovoDev Debug] Calling disableRovoDev' ) ;
307324 await this . disableRovoDev ( ) ;
308325 }
309326 }
310327
311328 private static async enableRovoDev ( context : ExtensionContext ) {
329+ console . log ( '[RovoDev Debug] enableRovoDev: START' ) ;
330+
312331 this . _isRovoDevEnabled = true ;
332+ console . log ( '[RovoDev Debug] enableRovoDev: Set _isRovoDevEnabled = true' ) ;
333+
313334 // Always set context key to ensure it's restored if lost (e.g., after reload or race conditions)
314335 await setCommandContext ( CommandContext . RovoDevEnabled , true ) ;
336+ console . log ( '[RovoDev Debug] enableRovoDev: Set VS Code context RovoDevEnabled = true' ) ;
315337
316338 // Always refresh help explorer to ensure UI is updated
317339 if ( ! this . isBoysenberryMode ) {
340+ console . log ( '[RovoDev Debug] enableRovoDev: Refreshing Help Explorer' ) ;
318341 this . _helpExplorer . refresh ( ) ;
319342 }
320343
321344 if ( this . _rovodevDisposable ) {
345+ console . log ( '[RovoDev Debug] enableRovoDev: Disposable already exists, refreshing credentials' ) ;
322346 if ( this . isBoysenberryMode ) {
323347 return ;
324348 }
@@ -331,6 +355,7 @@ export class Container {
331355 return ;
332356 }
333357 } else {
358+ console . log ( '[RovoDev Debug] enableRovoDev: Creating new disposable' ) ;
334359 try {
335360 // don't add anything async before initializing _rovodevDisposable
336361 this . _rovodevDisposable = vscode . Disposable . from (
@@ -339,6 +364,7 @@ export class Container {
339364 } ) ,
340365 ( this . _rovodevWebviewProvider = new RovoDevWebviewProvider ( context , context . extensionPath ) ) ,
341366 ) ;
367+ console . log ( '[RovoDev Debug] enableRovoDev: Disposable created successfully' ) ;
342368
343369 context . subscriptions . push ( this . _rovodevDisposable ) ;
344370
@@ -347,9 +373,11 @@ export class Container {
347373 await vscode . commands . executeCommand ( 'atlascode.views.rovoDev.webView.focus' ) ;
348374 } else {
349375 // Start the Rovo Dev process
376+ console . log ( '[RovoDev Debug] enableRovoDev: Initializing Rovo Dev process' ) ;
350377 await RovoDevProcessManager . initializeRovoDev ( context ) ;
351378 }
352379 } catch ( error ) {
380+ console . error ( '[RovoDev Debug] enableRovoDev: ERROR creating disposable:' , error ) ;
353381 RovoDevLogger . error ( error , 'Enabling Rovo Dev' ) ;
354382 }
355383 }
@@ -361,32 +389,45 @@ export class Container {
361389 RovoDevLogger . error ( error , 'Refreshing Jira issue views' ) ;
362390 return ;
363391 }
392+
393+ console . log ( '[RovoDev Debug] enableRovoDev: COMPLETE' ) ;
364394 }
365395
366396 private static async disableRovoDev ( ) {
397+ console . log ( '[RovoDev Debug] disableRovoDev: START' ) ;
398+
367399 if ( this . isBoysenberryMode ) {
400+ console . log ( '[RovoDev Debug] disableRovoDev: Skipping (Boysenberry mode)' ) ;
368401 RovoDevLogger . error ( new Error ( 'disableRovoDev called in Boysenberry mode' ) ) ;
369402 return ;
370403 }
371404
372405 this . _isRovoDevEnabled = false ;
406+ console . log ( '[RovoDev Debug] disableRovoDev: Set _isRovoDevEnabled = false' ) ;
373407
374408 if ( ! this . _rovodevDisposable ) {
409+ console . log ( '[RovoDev Debug] disableRovoDev: Already disabled (no disposable)' ) ;
375410 // Already disabled
376411 return ;
377412 }
378413
379414 // Update help explorer to hide Rovo Dev content
415+ console . log ( '[RovoDev Debug] disableRovoDev: Refreshing Help Explorer' ) ;
380416 this . _helpExplorer . refresh ( ) ;
381417
382418 try {
383419 // don't add anything async before disposing _rovodevDisposable
420+ console . log ( '[RovoDev Debug] disableRovoDev: Disposing disposable' ) ;
384421 this . _rovodevDisposable . dispose ( ) ;
385422 this . _rovodevDisposable = undefined ;
386423
387424 await setCommandContext ( CommandContext . RovoDevEnabled , false ) ;
425+ console . log ( '[RovoDev Debug] disableRovoDev: Set VS Code context RovoDevEnabled = false' ) ;
426+
388427 await RovoDevProcessManager . deactivateRovoDevProcessManager ( ) ;
428+ console . log ( '[RovoDev Debug] disableRovoDev: Deactivated process manager' ) ;
389429 } catch ( error ) {
430+ console . error ( '[RovoDev Debug] disableRovoDev: ERROR:' , error ) ;
390431 RovoDevLogger . error ( error , 'Disabling Rovo Dev' ) ;
391432 }
392433
@@ -397,6 +438,8 @@ export class Container {
397438 RovoDevLogger . error ( error , 'Refreshing Jira issue views' ) ;
398439 return ;
399440 }
441+
442+ console . log ( '[RovoDev Debug] disableRovoDev: COMPLETE' ) ;
400443 }
401444
402445 private static pushFeatureUpdatesToUI ( ) {
0 commit comments