-
Notifications
You must be signed in to change notification settings - Fork 117
Open
Labels
bugSomething isn't workingSomething isn't workingeditor/integrationEditor compatibility and CLI integrationEditor compatibility and CLI integration
Description
Bug
cbm_find_cli() never finds OpenCode or Aider on Windows because:
- It uses
:as PATH delimiter — Windows uses;. This splitsC:\Users\...at the drive letter colon, producing garbage paths. S_IXUSRcheck always fails —stat()on Windows does not set Unix permission bits. npm installs CLI shims as extensionless files (e.g.opencode, notopencode.exe), whichstat()finds but theS_IXUSRcheck rejects.
This was noted in commit 5ca369f3 which skips OpenCode/Aider in Windows smoke tests rather than fixing detection.
Reproduction
# Install opencode
npm install -g opencode-ai
# Verify it's on PATH
where.exe opencode
# C:\Users\<user>\AppData\Roaming\npm\opencode
# C:\Users\<user>\AppData\Roaming\npm\opencode.cmd
# Run install
codebase-memory-mcp install -y
# Detected agents: Claude-Code Gemini-CLI Zed Antigravity
# (OpenCode is missing)Root cause
In src/cli/cli.c, cbm_find_cli():
char *dir = strtok_r(path_copy, ":", &saveptr);
// ...
if (stat(buf, &st) == 0 && (st.st_mode & S_IXUSR)) {:delimiter splitsC:\Users\...at the drive letter colon → garbage pathsS_IXUSRis a Unix concept —stat()on Windows never sets this bit
Suggested fix
#ifdef _WIN32
const char *path_sep = ";";
#else
const char *path_sep = ":";
#endif
char *dir = strtok_r(path_copy, path_sep, &saveptr);
// ...
#ifdef _WIN32
if (stat(buf, &st) == 0) { // file exists is enough
#else
if (stat(buf, &st) == 0 && (st.st_mode & S_IXUSR)) {
#endifEnvironment
- Windows 11 Pro
- codebase-memory-mcp 0.5.7
- OpenCode installed via npm (opencode-ai)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingeditor/integrationEditor compatibility and CLI integrationEditor compatibility and CLI integration