Summary
The opencode provider hardcodes the data directory to ~/.local/share/opencode/ and only matches DB filenames prefixed opencode. Forks/renamed builds (e.g. MiMoCode → writes to ~/.local/share/mimocode/mimocode.db) silently produce no sessions, with no error to the user.
Reference: src/providers/opencode.ts
function getDataDir(dataDir?: string): string {
const base =
dataDir ??
process.env['XDG_DATA_HOME'] ??
join(homedir(), '.local', 'share')
return join(base, 'opencode') // ← hardcoded; can't point at a fork dir
}
dbFilePrefix: 'opencode' is also hardcoded, so even within the resolved dir only opencode*.db files match.
Reproduction
- Install a renamed/forked build of OpenCode that writes session data to e.g.
~/.local/share/mymod/mymod.db (same Drizzle schema: session, message, part).
- Run
codeburn status --provider opencode.
- Result: empty / "no data" — provider silently finds nothing. The user has no signal that the provider is just looking in the wrong place.
Proposed change
Allow users to point the opencode provider at a custom directory and DB filename prefix, mirroring the existing pattern in src/providers/codex.ts (which already accepts CODEX_HOME):
- Add an env var
OPENCODE_DATA_DIR (default: $XDG_DATA_HOME/opencode or ~/.local/share/opencode).
- Optionally
OPENCODE_DB_PREFIX (default: opencode) so the glob opencode*.db is configurable.
- Or, expose a
--provider-data-dir opencode=<path> flag.
Once configurable, the README's "Environment Variables" section should document the new vars.
Workaround
Until this lands, users with renamed builds can symlink:
mv ~/.local/share/opencode/opencode.db{,.stale}
ln -s ~/.local/share/mimocode/mimocode.db ~/.local/share/opencode/opencode.db
Schemas are compatible (verified: session, message, part all present with matching columns), so the symlink works.
Environment
- codeburn v0.9.15
- macOS, Node 22.13+
- Tested DB: fork writes to
~/.local/share/mimocode/mimocode.db (195 MB, 62 non-subtask sessions)
Summary
The
opencodeprovider hardcodes the data directory to~/.local/share/opencode/and only matches DB filenames prefixedopencode. Forks/renamed builds (e.g. MiMoCode → writes to~/.local/share/mimocode/mimocode.db) silently produce no sessions, with no error to the user.Reference:
src/providers/opencode.tsdbFilePrefix: 'opencode'is also hardcoded, so even within the resolved dir onlyopencode*.dbfiles match.Reproduction
~/.local/share/mymod/mymod.db(same Drizzle schema:session,message,part).codeburn status --provider opencode.Proposed change
Allow users to point the opencode provider at a custom directory and DB filename prefix, mirroring the existing pattern in
src/providers/codex.ts(which already acceptsCODEX_HOME):OPENCODE_DATA_DIR(default:$XDG_DATA_HOME/opencodeor~/.local/share/opencode).OPENCODE_DB_PREFIX(default:opencode) so the globopencode*.dbis configurable.--provider-data-dir opencode=<path>flag.Once configurable, the README's "Environment Variables" section should document the new vars.
Workaround
Until this lands, users with renamed builds can symlink:
Schemas are compatible (verified:
session,message,partall present with matching columns), so the symlink works.Environment
~/.local/share/mimocode/mimocode.db(195 MB, 62 non-subtask sessions)