MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / idx845_index_inprocess_check

Function idx845_index_inprocess_check

tests/test_mcp.c:21593–21615  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

21591};
21592
21593static int idx845_index_inprocess_check(const char *repo_dir) {
21594 int spawns_before = cbm_index_supervisor_spawn_count();
21595
21596 cbm_mcp_server_t *srv = cbm_mcp_server_new(NULL);
21597 if (!srv) {
21598 return IDX845_NO_RESULT;
21599 }
21600 char args[1024];
21601 snprintf(args, sizeof(args), "{\"repo_path\":\"%s\",\"mode\":\"fast\"}", repo_dir);
21602 char *resp = cbm_mcp_handle_tool(srv, "index_repository", args);
21603
21604 int code = IDX845_OK;
21605 if (cbm_index_supervisor_spawn_count() != spawns_before) {
21606 code = IDX845_SPAWNED;
21607 } else if (!resp) {
21608 code = IDX845_NO_RESULT;
21609 } else if (!response_contains_json_fragment(resp, "\"status\":\"indexed\"")) {
21610 code = IDX845_NOT_INDEXED;
21611 }
21612 free(resp);
21613 cbm_mcp_server_free(srv);
21614 return code;
21615}
21616
21617TEST(index_supervisor_gate_requires_marked_host_issue845) {
21618 /* #845: index_repository via cbm_mcp_handle_tool from an EMBEDDER (this test

Callers 1

test_mcp.cFile · 0.85

Calls 5

cbm_mcp_server_newFunction · 0.85
cbm_mcp_handle_toolFunction · 0.85
cbm_mcp_server_freeFunction · 0.85

Tested by

no test coverage detected