From c854b60f750eae6e9ede87499038469b5b17d6ad Mon Sep 17 00:00:00 2001 From: Hashaam Zahid <68606886+Hashaam101@users.noreply.github.com> Date: Wed, 20 May 2026 22:55:54 +0500 Subject: [PATCH] fix(scripts): scrub CI env vars in dev to keep interactive mode (#27159) --- scripts/start.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/scripts/start.js b/scripts/start.js index a94a22a2e0..a95a9d399b 100644 --- a/scripts/start.js +++ b/scripts/start.js @@ -66,6 +66,21 @@ const env = { DEV: 'true', }; +const keepCiEnv = + process.env.GEMINI_KEEP_CI_ENV === '1' || + process.env.GEMINI_KEEP_CI_ENV === 'true'; +if (!keepCiEnv) { + const ciKeys = ['CI', 'CONTINUOUS_INTEGRATION', 'GITHUB_ACTIONS'].filter( + (k) => k in env, + ); + if (ciKeys.length > 0) { + ciKeys.forEach((k) => delete env[k]); + process.stderr.write( + `[gemini] Removed CI env vars to keep interactive mode working in dev: ${ciKeys.join(', ')}. Set GEMINI_KEEP_CI_ENV=1 to disable.\n`, + ); + } +} + if (isInDebugMode) { // If this is not set, the debugger will pause on the outer process rather // than the relaunched process making it harder to debug.