V2 beta: isolate storage/database from stable OpenCode data · Issue #34831 · anomalyco/opencode · GitHub
Skip to content

V2 beta: isolate storage/database from stable OpenCode data #34831

Open

Description

@opencode-agent

Summary

Before a broader V2 beta/release, V2 should use a storage namespace/database that cannot interfere with the existing stable OpenCode database.

Why

In release prep discussion, the team called out that beta users should not corrupt or migrate production/stable user data. This is especially important while V2 table schemas, event names/versions, and migration-sensitive data are still being reviewed.

Scope

  • Decide whether V2 uses a separate SQLite database file, directory, namespace, or migration channel from stable/main OpenCode.
  • Ensure starting V2 does not eagerly migrate or mutate stable user data unless explicitly intended.
  • Document the migration/rollback behavior for beta users.
  • Verify CLI/TUI/Desktop/server paths all resolve the intended V2 storage location.
  • Add a smoke/regression check if there is a clean seam for it.

Related work

Source

Discord V2 TODO LIST discussion: https://discord.com/channels/1391832426048651334/1520962938733723720

Activity

  1. added
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on Jul 2, 2026
  2. Dante-dan commented on Oct 1, 2026

    @Dante-dan
    Contributor

    On current dev, latest, beta, and prod all resolve to opencode.db; opening the database applies migrations. A beta release channel alone therefore does not isolate V2.

    I propose a first milestone:

    • Give V2 a generation-specific database name (e.g. opencode-v2-beta.db) through the shared core resolver, including Desktop's embedded server. Keep stable's existing path unchanged.
    • Start with an empty V2 database; do not automatically import or migrate stable data. Rollback means reopening stable with its original database, retaining V2 data separately.
    • Treat OPENCODE_DB and OPENCODE_DISABLE_CHANNEL_DB explicitly: avoid silently opting a V2 release back into stable storage.
    • Add resolver coverage and a startup regression that checks stable schema/journal/data remain unchanged; check CLI/TUI/server/Desktop resolve the same V2 path.

    The shared data root also contains auth and auxiliary files, so database isolation alone is not full directory isolation. Should this milestone retain shared auth/config while isolating session/event storage, or should V2 have a separate data directory too? Please have the core team review and approve this boundary before implementation.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    2.0coreAnything pertaining to core functionality of the application (opencode server stuff)

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions