Reproduction
- Add
enableGlobalVirtualStore: true to pnpm-workspace.yaml
- Run
pnpm install — dependencies are installed (virtual store at <storeDir>/links)
- Remove
enableGlobalVirtualStore: true from pnpm-workspace.yaml
- Run
pnpm install — expected: deps reinstalled with local virtual store (node_modules/.pnpm) — actual: pnpm prints "Already up to date" and does nothing
Root cause
enableGlobalVirtualStore is missing from WORKSPACE_STATE_SETTING_KEYS in workspace/state/src/types.ts. The optimisticRepeatInstall fast path in installDeps calls checkDepsStatus before mutateModules. Since the workspace state file never recorded enableGlobalVirtualStore, the comparison finds nothing changed and short-circuits with upToDate: true — bypassing validateModules → checkCompatibility which would have detected the virtualStoreDir mismatch and triggered a purge + reinstall.
Fix
Add 'enableGlobalVirtualStore' to WORKSPACE_STATE_SETTING_KEYS in workspace/state/src/types.ts:
export const WORKSPACE_STATE_SETTING_KEYS = [
+ 'enableGlobalVirtualStore',
'allowBuilds',
'autoInstallPeers',
This ensures the workspace state detects the GVS toggle, checkDepsStatus returns upToDate: false, and the full mutateModules path runs (which includes the virtualStoreDir compatibility check and purge).
Written by an agent (opencode, glm-5.1).
Reproduction
enableGlobalVirtualStore: truetopnpm-workspace.yamlpnpm install— dependencies are installed (virtual store at<storeDir>/links)enableGlobalVirtualStore: truefrompnpm-workspace.yamlpnpm install— expected: deps reinstalled with local virtual store (node_modules/.pnpm) — actual: pnpm prints "Already up to date" and does nothingRoot cause
enableGlobalVirtualStoreis missing fromWORKSPACE_STATE_SETTING_KEYSinworkspace/state/src/types.ts. TheoptimisticRepeatInstallfast path ininstallDepscallscheckDepsStatusbeforemutateModules. Since the workspace state file never recordedenableGlobalVirtualStore, the comparison finds nothing changed and short-circuits withupToDate: true— bypassingvalidateModules→checkCompatibilitywhich would have detected thevirtualStoreDirmismatch and triggered a purge + reinstall.Fix
Add
'enableGlobalVirtualStore'toWORKSPACE_STATE_SETTING_KEYSinworkspace/state/src/types.ts:export const WORKSPACE_STATE_SETTING_KEYS = [ + 'enableGlobalVirtualStore', 'allowBuilds', 'autoInstallPeers',This ensures the workspace state detects the GVS toggle,
checkDepsStatusreturnsupToDate: false, and the fullmutateModulespath runs (which includes thevirtualStoreDircompatibility check and purge).Written by an agent (opencode, glm-5.1).