fix(cli): detect actual binary path at runtime in install command#160
Open
slvnlrt wants to merge 1 commit intoDeusData:mainfrom
Open
fix(cli): detect actual binary path at runtime in install command#160slvnlrt wants to merge 1 commit intoDeusData:mainfrom
slvnlrt wants to merge 1 commit intoDeusData:mainfrom
Conversation
install.ps1 places the binary in $LOCALAPPDATA/Programs/ but cbm_cmd_install() hardcoded ~/.local/bin/ when writing agent MCP configs, causing MCP to fail on Windows. Use GetModuleFileNameA (Win), _NSGetExecutablePath (macOS), or readlink /proc/self/exe (Linux) — same pattern as http_server.c:index_thread_fn(). Falls back to ~/.local/bin/ if runtime detection fails. Fixes DeusData#158
dd0ed38 to
6db11d6
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
cbm_cmd_install()hardcodes~/.local/bin/codebase-memory-mcp.exeas the binary path written into agent MCP configs. When installed viainstall.ps1(which targets$LOCALAPPDATA/Programs/), all agent configs point to a non-existent path — MCP fails for every agent.Fixes #158
Change
Single file:
src/cli/cli.cUse runtime binary path detection — the same pattern already in
http_server.c:index_thread_fn()(line 594):GetModuleFileNameA()+cbm_normalize_path_sep()_NSGetExecutablePath()readlink("/proc/self/exe")~/.local/bin/(preserves current behavior if detection fails)Added
#include <mach-o/dyld.h>for macOS.Testing
Runtime path detection is hard to unit-test (it depends on the actual binary location). The existing smoke tests (
smoke-test.sh) coverinstall -yend-to-end and will verify the configs point to a valid path.Manual verification on Windows: