From d836852e330c4f7a29fda0fc9a2668a32e80fbb5 Mon Sep 17 00:00:00 2001 From: Jonah Braun Date: Wed, 15 Apr 2026 16:00:58 -0600 Subject: [PATCH] fix(pinning): use conductor's getPinMismatches in pin-match gate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The gate was comparing the running extension version against the pin, which false-fires when a dev extension shadows the installed VSIX — the dev version (e.g. 0.24.0) differs from the pin (e.g. 0.24.0-pr856-…), so activation halted permanently with no reload ever coming. Switch to getPinMismatches, which asks the Conductor whether the pinned version is installed in the active profile (via getInstalled()). Dev extensions are invisible to getInstalled(), so the gate correctly answers "would the right version be running if there were no dev extension?". --- src/extension.ts | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/src/extension.ts b/src/extension.ts index 27e0cbbd8..c514f5568 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -180,27 +180,28 @@ function finishRealtimeStep(): number { async function failsPinMatchGate(activationStart: number): Promise { const EXTENSION_ID = "project-accelerate.codex-editor-extension"; - let effectivePins: Record | undefined; + // Ask the Conductor whether the pinned version is installed in the active + // profile. Using getPinMismatches (which calls getInstalled()) rather than + // checking the running extension version means dev extensions that shadow + // the installed VSIX don't cause a false mismatch — the gate answers + // "would the right version be running if there were no dev extension?" + let mismatches: Array<{ extensionId: string; pinnedVersion: string; runningVersion: string | null }> | undefined; try { - effectivePins = await vscode.commands.executeCommand( - "codex.conductor.getEffectivePinnedExtensions" + mismatches = await vscode.commands.executeCommand( + "codex.conductor.getPinMismatches" ); } catch { // Conductor command not available in older Codex builds return false; } - if (!effectivePins) return false; + if (!mismatches || mismatches.length === 0) return false; - const myPin = effectivePins[EXTENSION_ID]; - if (!myPin) return false; - - const myVersion = MetadataManager.getCurrentExtensionVersion(EXTENSION_ID); - if (!myVersion) return false; // unknown — can't decide - if (myVersion === myPin.version) { - return false; - } + const myMismatch = mismatches.find( + m => m.extensionId.toLowerCase() === EXTENSION_ID.toLowerCase() + ); + if (!myMismatch) return false; - console.log(`[Extension] Pin mismatch: ${myVersion} != ${myPin.version}. Halting at pin-match gate.`); + console.log(`[Extension] Pin mismatch (conductor): installed=${myMismatch.runningVersion ?? "none"} != pinned=${myMismatch.pinnedVersion}. Halting at pin-match gate.`); trackTiming("Starting Project Synchronization (Version Pin Enforcement)", activationStart); return true; }