@@ -102,11 +102,6 @@ export class ClineProvider extends EventEmitter<ClineProviderEvents> implements
102102 this . contextProxy = new ContextProxy ( context )
103103 ClineProvider . activeInstances . add ( this )
104104
105- // Check experiments and set apiLoggingEnabled
106- this . getState ( ) . then ( ( state ) => {
107- ClineProvider . apiLoggingEnabled = state . experiments ?. [ EXPERIMENT_IDS . API_LOGGING ] ?? false
108- } )
109-
110105 // Register this provider with the telemetry service to enable it to add
111106 // properties like mode and provider.
112107 telemetryService . setProvider ( this )
@@ -129,6 +124,11 @@ export class ClineProvider extends EventEmitter<ClineProviderEvents> implements
129124 } )
130125 }
131126
127+ private async initializeApiLogging ( ) {
128+ const state = await this . getState ( )
129+ ClineProvider . apiLoggingEnabled = state . experiments ?. [ EXPERIMENT_IDS . API_LOGGING ] ?? false
130+ }
131+
132132 // Adds a new Cline instance to clineStack, marking the start of a new task.
133133 // The instance is pushed to the top of the stack (LIFO order).
134134 // When the task is completed, the top instance is removed, reactivating the previous task.
@@ -351,6 +351,9 @@ export class ClineProvider extends EventEmitter<ClineProviderEvents> implements
351351 await this . contextProxy . initialize ( )
352352 }
353353
354+ // Initialize API logging before proceeding
355+ await this . initializeApiLogging ( )
356+
354357 this . view = webviewView
355358
356359 // Set panel reference according to webview type
0 commit comments