MiniMax-AI / MiniMax-AI/minimax-code

MiniMax Code uses OpenCode's database path instead of its own, causing data conflict

Open Beginner friendly
#87 2 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug desktop
Dominant language
TypeScript
Stars
1.3k
Forks
141
Avg merge
2h 45m
Merged PRs (30d)
46

Description

Description

MiniMax Code desktop app (v3.0.46) runs an older version of OpenCode (v1.14.28) as a backend server. The problem is that this server stores its sessions and data at the same path (~/.local/share/opencode/opencode.db) that is already used by a separately installed OpenCode — an independent, unrelated program.

Two different applications are trying to write their session data into the same database file. When the separately installed OpenCode initializes first, MiniMax Code then attempts to use the same file with a different internal schema expectation, resulting in:

[stream.message] Failed to create session: 500
DrizzleError: Failed to run the query 'CREATE TABLE `project` (...)'

The core issue is that MiniMax Code has no database path of its own. Each program should own its data directory. MiniMax Code should create and manage its database under a minimax namespace (e.g. ~/.local/share/minimax-code/), not under opencode which belongs to a separate piece of software.

Steps to reproduce

  1. Install OpenCode CLI separately from MiniMax Code
  2. Run it at least once so its database is initialized at ~/.local/share/opencode/
  3. Install and launch MiniMax Code
  4. Send a message to any agent — request fails because both programs conflict over the same database file

Expected behavior

MiniMax Code should create and use its own dedicated database path, isolated from OpenCode or any other software. The database path should reflect the MiniMax brand, not OpenCode's.

Suggested fix

Set OPENCODE_DB environment variable for the backend server process to a MiniMax-specific path:

OPENCODE_DB=~/.local/share/minimax-code/minimax-code.db

This can be done in dist/main/modules/daemon/spawn-prod.js by adding the variable to the env block passed to child_process.spawn(). The bundled OpenCode binary natively supports the OPENCODE_DB env var for exactly this purpose — overriding the default database location.

Environment

  • macOS 15 (Apple Silicon)
  • MiniMax Code v3.0.46
  • Separately installed OpenCode v1.17.9

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with dist/main/modules/daemon/spawn-prod.js and inspect the env block passed to child_process.spawn() for the backend server. Set the bundled server's database path to the MiniMax-specific location described in the issue, then launch MiniMax Code alongside a separately installed OpenCode and confirm their database files are isolated and agent messages no longer fail.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
backend, database
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
82/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.