mirror of
https://github.com/DeusData/codebase-memory-mcp.git
synced 2026-11-09 09:11:00 +08:00
fix(mcp): report blocked automatic indexing by active tool mode
Previously, build_project_list_error_srv discarded whether automatic indexing was disabled or stopped by auto_index_limit and always recommended index_repository, even when streamlined tools/list hid that tool. Double-quoted path examples could also invalidate the nested structured JSON response. Record request-thread-owned block state in maybe_auto_index and cbm_mcp_auto_index_within_limit. mcp_index_recovery_action at src/mcp/mcp.c:3937 now uses the existing profile/reveal authorities: classic or revealed streamlined mode calls index_repository directly, unrevealed streamlined mode calls _hidden_tools and refreshes tools/list first, and profiles without that tool use the CLI. Existing synchronous first-use recovery still runs before any user action is emitted. Centralize streamlined/classic config values in src/cli/cli.h:383. tests/test_mcp.c:9617 covers auto_index=false, bounded file-limit rejection, classic, and revealed streamlined behavior; each response must parse as JSON with structuredContent and must not claim auto_indexing. Verified: focused ASan/UBSan test 1/1; scripts/check-source-safety.sh; git diff --check; git clang-format --diff; staged private-path scan. Signed-off-by: Andrew Hundt <ATHundt@gmail.com>
This commit is contained in:
@@ -380,6 +380,8 @@ int cbm_config_apply_preset(cbm_config_t *cfg, const char *name);
|
||||
#define CBM_CONFIG_SEARCH_LIMIT "search_limit"
|
||||
#define CBM_CONFIG_QUERY_MAX_ROWS "query_max_rows"
|
||||
#define CBM_CONFIG_TOOL_MODE "tool_mode"
|
||||
#define CBM_CONFIG_TOOL_MODE_STREAMLINED "streamlined"
|
||||
#define CBM_CONFIG_TOOL_MODE_CLASSIC "classic"
|
||||
#define CBM_CONFIG_DEFAULT_RESPONSE_FORMAT "default_response_format"
|
||||
#define CBM_DEFAULT_QUERY_MAX_ROWS 100000
|
||||
#define CBM_DEFAULT_QUERY_MAX_ROWS_STR "100000"
|
||||
|
||||
Reference in New Issue
Block a user