From 4df8dbaa0da1ce1e42b0dcbb37c8093fb1ababb4 Mon Sep 17 00:00:00 2001 From: MRK Date: Tue, 16 Sep 2025 23:08:23 -0700 Subject: [PATCH] Fix to issue #736 resulting in GEMINI_CLI_AUTH_TYPE not getting populated most of the time in the start_session events (#8508) Co-authored-by: owenofbrien <86964623+owenofbrien@users.noreply.github.com> Co-authored-by: Arya Gummadi --- packages/core/src/config/config.test.ts | 2 +- packages/core/src/config/config.ts | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/core/src/config/config.test.ts b/packages/core/src/config/config.test.ts index c83102f0b8..fa56744eb5 100644 --- a/packages/core/src/config/config.test.ts +++ b/packages/core/src/config/config.test.ts @@ -422,7 +422,7 @@ describe('Server Config (config.ts)', () => { ...baseParams, usageStatisticsEnabled: true, }); - await config.initialize(); + await config.refreshAuth(AuthType.USE_GEMINI); expect( ClearcutLogger.prototype.logStartSessionEvent, diff --git a/packages/core/src/config/config.ts b/packages/core/src/config/config.ts index dc03743988..a8a21d7b00 100644 --- a/packages/core/src/config/config.ts +++ b/packages/core/src/config/config.ts @@ -459,7 +459,6 @@ export class Config { } this.promptRegistry = new PromptRegistry(); this.toolRegistry = await this.createToolRegistry(); - logCliConfiguration(this, new StartSessionEvent(this, this.toolRegistry)); await this.geminiClient.initialize(); } @@ -496,6 +495,9 @@ export class Config { // Reset the session flag since we're explicitly changing auth and using default model this.inFallbackMode = false; + + // Logging the cli configuration here as the auth related configuration params would have been loaded by this point + logCliConfiguration(this, new StartSessionEvent(this, this.toolRegistry)); } getUserTier(): UserTierId | undefined {