Skip to content

fix(core): isolate opencode2 database - #42389

Draft
dajiaohuang wants to merge 1 commit into
anomalyco:devfrom
dajiaohuang:fix-opencode2-database-isolation
Draft

fix(core): isolate opencode2 database#42389
dajiaohuang wants to merge 1 commit into
anomalyco:devfrom
dajiaohuang:fix-opencode2-database-isolation

Conversation

@dajiaohuang

Copy link
Copy Markdown

Issue for this PR

#42260

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

This draft keeps the separately named opencode2 preview from opening the stable opencode.db by default. It derives opencode2.db from 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_DB and OPENCODE_DISABLE_CHANNEL_DB overrides keep their current behavior, so sharing remains an opt-in escape hatch.

Assumption for review: the opencode2 executable 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.ts from packages/core: 4 passed
  • bun typecheck from packages/core: passed
  • Full packages/core test run: 1081 passed, 7 skipped, with 6 unrelated Windows failures in existing npm-config and cross-spawn tests

Screenshots / recordings

Not applicable; this changes database path selection.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@github-actions

Copy link
Copy Markdown
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant