Skip to content

Desktop crashes at startup: V1 history migration fails with "Bun is not defined" #102

Closed

Description

@trmosala

Since #100 merged, the desktop app crashes on first launch for profiles with existing V1 chat history.

The sidecar logs V1 migration failed, exits with code 1, and the renderer shows a fatal error: V1 history migration failed: Bun is not defined.

Cause: the published @opencode/core 2.2.5 V1 migration (database/v1-migration.bun.js) calls new Bun.CryptoHasher("sha256") when generating synthetic IDs. CookieMonster runs that migration under Electron's Node, where Bun does not exist. Only histories that need synthetic IDs reach the call, so mock fixtures and the Bun-run unit tests never hit it.

Reproduced with CM_BRAND=1 bun run dev:desktop against a real dev profile.

Activity

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions