fix(core): simplify directory lock fallback safety#27
Merged
Conversation
- Use a bundled directory-based lock when proper-lockfile cannot be resolved so cache locking still works in packaged/runtime environments. - Target: core
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
proper-lockfileimport-shape fix so the plugin can load when the package resolves as a CommonJS-style namespaceRoot Cause
The plugin auth flow was not failing inside the auth menu first. It was failing earlier while loading the plugin because
proper-lockfiledid not expose an ESM default in this environment. The first lockfile patch fixed that loader mismatch, but the later fallback work introduced race-prone stale-reclaim behavior that was riskier than the original problem.What Changed
lib/cache-lock.tsproper-lockfilefrom both direct and namespace-shaped module exportsrelease()can avoid deleting a replacement locktest/cache-lock.test.ts../indexwith a CommonJS-styleproper-lockfileshapeValidation
npm run verifyopencode auth login --print-logs/Users/bryanfont/Projects/iam-brain/opencode-openai-multi/dist/index.jsproper-lockfileload failureFollow-up
The earlier TTY auth investigation is still preserved in stash for the separate follow-up PR.