From b53db1b07c38f2444103245853d34a22c0de2d87 Mon Sep 17 00:00:00 2001 From: Ariane Emory Date: Sun, 8 Mar 2026 17:27:52 -0400 Subject: [PATCH] fix: always use single database (opencode.db) Remove channel-specific database logic to prevent surprise empty databases in dev mode. Always use opencode.db regardless of channel. This reverts the behavior to always use a single shared database. --- packages/opencode/src/storage/db.ts | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/packages/opencode/src/storage/db.ts b/packages/opencode/src/storage/db.ts index cd920a8907c..3c87c621de5 100644 --- a/packages/opencode/src/storage/db.ts +++ b/packages/opencode/src/storage/db.ts @@ -12,9 +12,7 @@ import z from "zod" import path from "path" import { readFileSync, readdirSync, existsSync } from "fs" import * as schema from "./schema" -import { Installation } from "../installation" import { Flag } from "../flag/flag" -import { iife } from "@/util/iife" declare const OPENCODE_MIGRATIONS: { sql: string; timestamp: number; name: string }[] | undefined @@ -28,13 +26,7 @@ export const NotFoundError = NamedError.create( const log = Log.create({ service: "db" }) export namespace Database { - export const Path = iife(() => { - const channel = Installation.CHANNEL - if (["latest", "beta"].includes(channel) || Flag.OPENCODE_DISABLE_CHANNEL_DB) - return path.join(Global.Path.data, "opencode.db") - const safe = channel.replace(/[^a-zA-Z0-9._-]/g, "-") - return path.join(Global.Path.data, `opencode-${safe}.db`) - }) + export const Path = path.join(Global.Path.data, "opencode.db") type Schema = typeof schema export type Transaction = SQLiteTransaction<"sync", void, Schema>