Repository navigation
fix(core): isolate opencode2 database - #42389
dajiaohuang wants to merge 1 commit into
Conversation
|
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. |
|
Automated PR Cleanup Thank you for contributing to opencode. Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions. This PR was closed because it matched the following cleanup criteria:
PRs created within the last month are not affected by this cleanup. If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate. Thanks again for taking the time to contribute. |
|
I am still working on the compatibility report from #42260, so please reopen this PR if a separate default database for opencode2 is an acceptable scope. In the reported setup opencode2 used the latest channel; current dev still maps latest, beta, and prod to opencode.db, so the stable/V2 collision remains possible. I asked about the coexistence contract on #42260, which was closed without an answer. The related open #44028 reports a separate mixed-generation session visibility problem. This patch isolates the opencode2 database only; it does not change other XDG paths or solve cross-channel migration. |
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