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

Function idx845_index_inprocess_check

tests/test_mcp.c:9622–9644  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9620};
9621
9622static int idx845_index_inprocess_check(const char *repo_dir) {
9623 int spawns_before = cbm_index_supervisor_spawn_count();
9624
9625 cbm_mcp_server_t *srv = cbm_mcp_server_new(NULL);
9626 if (!srv) {
9627 return IDX845_NO_RESULT;
9628 }
9629 char args[1024];
9630 snprintf(args, sizeof(args), "{\"repo_path\":\"%s\",\"mode\":\"fast\"}", repo_dir);
9631 char *resp = cbm_mcp_handle_tool(srv, "index_repository", args);
9632
9633 int code = IDX845_OK;
9634 if (cbm_index_supervisor_spawn_count() != spawns_before) {
9635 code = IDX845_SPAWNED;
9636 } else if (!resp) {
9637 code = IDX845_NO_RESULT;
9638 } else if (!response_contains_json_fragment(resp, "\"status\":\"indexed\"")) {
9639 code = IDX845_NOT_INDEXED;
9640 }
9641 free(resp);
9642 cbm_mcp_server_free(srv);
9643 return code;
9644}
9645
9646TEST(index_supervisor_gate_requires_marked_host_issue845) {
9647 /* #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