From f967fdde89dd65247852ce8f1dc34f4e8008e85f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Davor=20Raci=C4=87?= Date: Mon, 9 Feb 2026 08:43:53 +0100 Subject: [PATCH] fix: propagate skipPrompts flag to IDE collectConfiguration calls The --yes flag (skipPrompts) was not being passed through to IDE handler collectConfiguration() calls, causing the Codex installer to hang on its interactive prompt in non-interactive mode (CI/CD, --yes flag). - Add skipPrompts parameter to collectToolConfigurations() and forward it to handler.collectConfiguration() options - Add early return in CodexSetup.collectConfiguration() when skipPrompts is true, defaulting to global install location - Guard IDE removal confirmation prompt with skipPrompts check, defaulting to preserve existing configs (consistent with prompt default: false) Fixes #1610 Co-Authored-By: Claude Opus 4.6 --- tools/cli/installers/lib/core/installer.js | 23 +++++++++++++++++----- tools/cli/installers/lib/ide/codex.js | 5 +++++ 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/tools/cli/installers/lib/core/installer.js b/tools/cli/installers/lib/core/installer.js index 8601e1aaa..5cf8f4427 100644 --- a/tools/cli/installers/lib/core/installer.js +++ b/tools/cli/installers/lib/core/installer.js @@ -109,9 +109,17 @@ class Installer { * @param {boolean} isFullReinstall - Whether this is a full reinstall * @param {Array} previousIdes - Previously configured IDEs (for reinstalls) * @param {Array} preSelectedIdes - Pre-selected IDEs from early prompt (optional) + * @param {boolean} skipPrompts - Skip prompts and use defaults (for --yes flag) * @returns {Object} Tool/IDE selection and configurations */ - async collectToolConfigurations(projectDir, selectedModules, isFullReinstall = false, previousIdes = [], preSelectedIdes = null) { + async collectToolConfigurations( + projectDir, + selectedModules, + isFullReinstall = false, + previousIdes = [], + preSelectedIdes = null, + skipPrompts = false, + ) { // Use pre-selected IDEs if provided, otherwise prompt let toolConfig; if (preSelectedIdes === null) { @@ -182,6 +190,7 @@ class Installer { selectedModules: selectedModules || [], projectDir, bmadDir, + skipPrompts, }); } else { // Config-driven IDEs don't need configuration - mark as ready @@ -684,6 +693,7 @@ class Installer { config._isFullReinstall || false, config._previouslyConfiguredIdes || [], preSelectedIdes, + config.skipPrompts || false, ); } @@ -709,10 +719,13 @@ class Installer { await prompts.log.error(` - ${ide}`); } - const confirmRemoval = await prompts.confirm({ - message: `Remove BMAD configuration for ${idesToRemove.length} IDE(s)?`, - default: false, - }); + // In non-interactive mode, preserve existing configs (matches prompt default: false) + const confirmRemoval = config.skipPrompts + ? false + : await prompts.confirm({ + message: `Remove BMAD configuration for ${idesToRemove.length} IDE(s)?`, + default: false, + }); if (confirmRemoval) { await this.ideManager.ensureInitialized(); diff --git a/tools/cli/installers/lib/ide/codex.js b/tools/cli/installers/lib/ide/codex.js index 8e91e003b..143402282 100644 --- a/tools/cli/installers/lib/ide/codex.js +++ b/tools/cli/installers/lib/ide/codex.js @@ -23,6 +23,11 @@ class CodexSetup extends BaseIdeSetup { * @returns {Object} Collected configuration */ async collectConfiguration(options = {}) { + // Non-interactive mode: use default (global) + if (options.skipPrompts) { + return { installLocation: 'global' }; + } + let confirmed = false; let installLocation = 'global';