Skip to content

Commit f6a2927

Browse files
committed
fix(mcp): normalize the autoindex.skip root path in diagnostics (DeusData#713)
The autoindex over-limit skip warning logged `root=` with the raw srv->session_root, which on Windows carries backslashes. The DeusData#713 guard test autoindex_limit_guards_non_git_root_issue713 asserts the warning names the skipped root via strstr(root, "/repo"), so it failed on the Windows CLANG64 (x86_64) leg where the path is `...\repo`. Normalize the logged root to forward slashes with cbm_normalize_path_sep() (a no-op on POSIX), matching cbm's forward-slash path convention used everywhere else in the graph and MCP output; the diagnostic is now identical across platforms. Production-side fix, not a test relaxation. Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
1 parent 9ef7da8 commit f6a2927

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

‎src/mcp/mcp.c‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17532,9 +17532,13 @@ static void maybe_auto_index(cbm_mcp_server_t *srv) {
1753217532
char limit[32];
1753317533
(void)snprintf(files, sizeof(files), "%d", file_count);
1753417534
(void)snprintf(limit, sizeof(limit), "%d", file_limit);
17535+
char root_disp[CBM_SZ_1K];
17536+
(void)snprintf(root_disp, sizeof(root_disp), "%s", srv->session_root);
17537+
cbm_normalize_path_sep(
17538+
root_disp); /* forward-slash paths in diagnostics (Windows \\ -> /) */
1753517539
cbm_log_warn("autoindex.skip", "reason",
1753617540
file_count >= 0 ? "too_many_files" : "unsafe_or_unavailable_path", "files",
17537-
files, "limit", limit, "root", srv->session_root);
17541+
files, "limit", limit, "root", root_disp);
1753817542
return;
1753917543
}
1754017544

0 commit comments

Comments
 (0)