Skip to content

Local code intelligence for developers and AI agents. Connect code, docs and infrastructure in a persistent graph, with CBM Lens, MCP tools, agent integrations and change-aware test selection.

Fix Windows agent detection paths to use home_dir consistently

Martin Vogel616a4307df9c
diff --git a/src/cli/cli.c b/src/cli/cli.c
index bb41b32ff..f54903ae5 100644
--- a/src/cli/cli.c
+++ b/src/cli/cli.c
@@ -990,12 +990,7 @@ cbm_detected_agents_t cbm_detect_agents(const char *home_dir) {
#ifdef __APPLE__
snprintf(path, sizeof(path), "%s/Library/Application Support/Zed", home_dir);
#elif defined(_WIN32)
- {
- const char *zed_local = cbm_app_local_dir();
- if (zed_local) {
- snprintf(path, sizeof(path), "%s/Zed", zed_local);
- }
- }
+ snprintf(path, sizeof(path), "%s/AppData/Local/Zed", home_dir);
#else
snprintf(path, sizeof(path), "%s/.config/zed", home_dir);
#endif
@@ -1014,6 +1009,9 @@ cbm_detected_agents_t cbm_detect_agents(const char *home_dir) {
#ifdef __APPLE__
snprintf(path, sizeof(path),
"%s/Library/Application Support/Code/User/globalStorage/kilocode.kilo-code", home_dir);
+#elif defined(_WIN32)
+ snprintf(path, sizeof(path), "%s/AppData/Roaming/Code/User/globalStorage/kilocode.kilo-code",
+ home_dir);
#else
snprintf(path, sizeof(path), "%s/.config/Code/User/globalStorage/kilocode.kilo-code", home_dir);
#endif
@@ -1021,6 +1019,8 @@ cbm_detected_agents_t cbm_detect_agents(const char *home_dir) {
#ifdef __APPLE__
snprintf(path, sizeof(path), "%s/Library/Application Support/Code/User", home_dir);
+#elif defined(_WIN32)
+ snprintf(path, sizeof(path), "%s/AppData/Roaming/Code/User", home_dir);
#else
snprintf(path, sizeof(path), "%s/.config/Code/User", home_dir);
#endif
diff --git a/tests/test_cli.c b/tests/test_cli.c
index 50829d182..deb015c62 100644
--- a/tests/test_cli.c
+++ b/tests/test_cli.c
@@ -1438,6 +1438,8 @@ TEST(cli_detect_agents_finds_zed) {
char dir[512];
#ifdef __APPLE__
snprintf(dir, sizeof(dir), "%s/Library/Application Support/Zed", tmpdir);
+#elif defined(_WIN32)
+ snprintf(dir, sizeof(dir), "%s/AppData/Local/Zed", tmpdir);
#else
snprintf(dir, sizeof(dir), "%s/.config/zed", tmpdir);
#endif
@@ -1478,6 +1480,9 @@ TEST(cli_detect_agents_finds_kilocode) {
#ifdef __APPLE__
snprintf(dir, sizeof(dir),
"%s/Library/Application Support/Code/User/globalStorage/kilocode.kilo-code", tmpdir);
+#elif defined(_WIN32)
+ snprintf(dir, sizeof(dir),
+ "%s/AppData/Roaming/Code/User/globalStorage/kilocode.kilo-code", tmpdir);
#else
snprintf(dir, sizeof(dir), "%s/.config/Code/User/globalStorage/kilocode.kilo-code", tmpdir);
#endif