fix(core): isolate opencode2 database - #42389
Draft
dajiaohuang wants to merge 1 commit into
Draft
Conversation
Contributor
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
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.
Issue for this PR
#42260
Type of change
What does this PR do?
This draft keeps the separately named
opencode2preview from opening the stableopencode.dbby default. It derivesopencode2.dbfrom the running executable name before applying the existing release-channel fallback.The patch deliberately does not migrate, copy, or repair an existing database. Explicit
OPENCODE_DBandOPENCODE_DISABLE_CHANNEL_DBoverrides keep their current behavior, so sharing remains an opt-in escape hatch.Assumption for review: the
opencode2executable name is the compatibility boundary. A broader alternative would isolate the complete XDG data/state/config namespace or copy stable data into a preview namespace. This draft uses the smaller database-only boundary because it prevents incompatible migrations while leaving unrelated paths unchanged.How did you verify your code works?
bun test test/database-path.test.tsfrompackages/core: 4 passedbun typecheckfrompackages/core: passedpackages/coretest run: 1081 passed, 7 skipped, with 6 unrelated Windows failures in existing npm-config and cross-spawn testsScreenshots / recordings
Not applicable; this changes database path selection.
Checklist