-
-
Notifications
You must be signed in to change notification settings - Fork 59
Closed
Description
Description
The DCP config loader and logger hardcode homedir()/.config/opencode for resolving paths, ignoring the XDG_CONFIG_HOME and XDG_DATA_HOME environment variables. This causes DCP to fail to find its config file and fail to write debug logs for any user running with custom XDG base directories.
Affected Files
lib/config.ts—GLOBAL_CONFIG_DIRusesjoin(homedir(), ".config", "opencode")instead of checkingXDG_CONFIG_HOMElib/logger.ts—logDirusesjoin(homedir(), ".config", "opencode")instead of checkingXDG_DATA_HOME
Expected Behavior
DCP should respect XDG base directory environment variables per the XDG Base Directory Specification:
XDG_CONFIG_HOME→ config files (default:~/.config)XDG_DATA_HOME→ data/log files (default:~/.local/share)
OpenCode itself respects these variables. DCP should too, otherwise its config and logs end up in a different location than the rest of OpenCode when users set custom XDG paths.
Steps to Reproduce
- Set
XDG_CONFIG_HOMEto a custom path (e.g.,/tmp/test-config) - Place
dcp.jsoncat$XDG_CONFIG_HOME/opencode/dcp.jsoncwith"debug": true - Run OpenCode — DCP ignores the config and uses defaults
- No debug logs appear at
$XDG_DATA_HOME/opencode/logs/dcp/
Environment
- OS: Windows 10 (also affects Linux/macOS users with custom XDG paths)
- OpenCode: 1.1.48
- DCP: 1.2.7+
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels