From 0862df15df029a08f104af618749553a8312f103 Mon Sep 17 00:00:00 2001 From: Tom Boucher Date: Fri, 15 May 2026 22:56:32 -0400 Subject: [PATCH] fix(3610): replace resolved prompt actions and keep explicit block path --- .../bin/lib/installer-migration-report.cjs | 13 ++++++++++--- ...installer-migration-install-integration.test.cjs | 4 ++-- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/get-shit-done/bin/lib/installer-migration-report.cjs b/get-shit-done/bin/lib/installer-migration-report.cjs index b620f2f4c..c79f539ba 100644 --- a/get-shit-done/bin/lib/installer-migration-report.cjs +++ b/get-shit-done/bin/lib/installer-migration-report.cjs @@ -217,10 +217,17 @@ function resolveInstallerMigrationPromptsForNonTty(result, options = {}) { if (choice) { const resolved = materializeResolution(action, choice); - // Inject the concrete action into plan.actions so the apply - // step picks it up. + // Replace the original prompt-user action in-place when present so + // applyInstallerMigrationPlan never sees an unsupported action type. + // Fallback to append only when the blocked action did not originate + // from plan.actions (defensive). if (result.plan && Array.isArray(result.plan.actions)) { - result.plan.actions.push(resolved); + const idx = result.plan.actions.indexOf(action); + if (idx >= 0) { + result.plan.actions[idx] = resolved; + } else { + result.plan.actions.push(resolved); + } } resolutions.push({ relPath: action.relPath, diff --git a/tests/installer-migration-install-integration.test.cjs b/tests/installer-migration-install-integration.test.cjs index 9fb0aeba9..5f824ad9a 100644 --- a/tests/installer-migration-install-integration.test.cjs +++ b/tests/installer-migration-install-integration.test.cjs @@ -306,7 +306,7 @@ describe('installer migration install integration', { concurrency: false }, () = }); test('blocks install before materialization when baseline needs explicit user choice', () => { - writeFile(codexHome, 'hooks/gsd-retired-hook.js', 'old gsd hook\n'); + writeFile(codexHome, 'hooks/gsd-retired-hook.txt', 'old gsd hook\n'); assert.throws( () => captureConsole(() => @@ -315,7 +315,7 @@ describe('installer migration install integration', { concurrency: false }, () = /installer migration blocked/ ); - assert.equal(fs.readFileSync(path.join(codexHome, 'hooks/gsd-retired-hook.js'), 'utf8'), 'old gsd hook\n'); + assert.equal(fs.readFileSync(path.join(codexHome, 'hooks/gsd-retired-hook.txt'), 'utf8'), 'old gsd hook\n'); assert.equal(fs.existsSync(path.join(codexHome, 'skills')), false); assert.equal(fs.existsSync(path.join(codexHome, 'get-shit-done', 'VERSION')), false); });