MiniMax-AI / MiniMax-AI/minimax-code
MiniMax Code uses OpenCode's database path instead of its own, causing data conflict
Nobody has claimed this yet.
- 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
- Install OpenCode CLI separately from MiniMax Code
- Run it at least once so its database is initialized at
~/.local/share/opencode/ - Install and launch MiniMax Code
- 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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